public LoginCallback create(final Controller controller) {
        try {
            final Constructor<? extends LoginCallback> constructor
                    = ConstructorUtils.getMatchingAccessibleConstructor(clazz, controller.getClass());
            if(null == constructor) {
                log.warn(String.format("No matching constructor for parameter %s", controller.getClass()));
                // Call default constructor for disabled implementations
                return clazz.getDeclaredConstructor().newInstance();
            }
            return constructor.newInstance(controller);
        }
        catch(InstantiationException | InvocationTargetException | IllegalAccessException | NoSuchMethodException e) {
            log.error(String.format("Failure loading callback class %s. %s", clazz, e.getMessage()));
            return new DisabledLoginCallback();
        }
    }
@Test
    public void testCreateOrder() {
        final LoginCallbackFactory factory = new LoginCallbackFactory(TestLoginCallback.class);
        assertEquals(DisabledLoginCallback.class, factory.create(new BaseController()).getClass());
        assertEquals(TestLoginCallback.class, factory.create(new TestBrowserController()).getClass());
        assertEquals(DisabledLoginCallback.class, factory.create(new BaseController()).getClass());
    }