@Test
void withInjectorProxy() throws InstantiationException {

    final class MyTestInjectorProxy implements InjectorProxy {
        @Override public boolean isApplicable(Class<?> clazz) { return true; }
        @Override public void set(Field field, Object instance, Object value) { throw new UnsupportedOperationException(); }
        @Override public Object invoke(Method method, Object obj, Object... args) { throw new UnsupportedOperationException(); }
        @Override
        public <T> T newInstance(Constructor<T> constructor, Object... args) throws IllegalAccessException, InvocationTargetException, InstantiationException {
            final T result = constructor.newInstance(args);
            if (result instanceof Bar) {
                ((Bar)result).val = 1;
            }
            return result;
        }
    }
    final Injector injector = instance.withInjectorProxy(new MyTestInjectorProxy()).withComponent(Bar.class).build();
    assertEquals(1, injector.getOrThrow(Bar.class).val);
}