### Question:
JCommanderWrapper implements CommandBuilder<T> { private static void inject(Object object, JCommander commander) { for (Class<?> current = object.getClass(); current != Object.class && current != null; current = current.getSuperclass()) { for (Field f : current.getDeclaredFields()) { try { if (f.getType() == JCommander.class && f.isAnnotationPresent(Inject.class)) { f.setAccessible(true); f.set(object, commander); } if (f.isAnnotationPresent(ParametersDelegate.class)) { f.setAccessible(true); Object delegate = f.get(object); inject(delegate, commander); } } catch (ReflectiveOperationException e) { throw new IllegalStateException(MessageFormat.format( "error occurred while injecting JCommander object: {0}#{1}", object.getClass().getName(), f.getName()), e); } } } } JCommanderWrapper(String programName, Object command); @Override JCommanderWrapper<T> configure(Consumer<? super CommandBuilder<T>> configurator); @Override JCommanderWrapper<T> addCommand(T command); @Override JCommanderWrapper<T> addCommand(String name, T command); @Override JCommanderWrapper<T> addGroup(T command, Consumer<? super CommandBuilder<T>> configurator); @Override JCommanderWrapper<T> addGroup(String name, T command, Consumer<? super CommandBuilder<T>> configurator); Optional<T> parse(String... args); static void handle(ParameterException exception, Consumer<? super String> sink);  }### Answer:
@Test public void inject() { JCommanderWrapper<Supplier<String>> commander = new JCommanderWrapper<>("PG", new Inj()); Optional<String> result = commander.parse().map(Supplier::get); assertThat(result, is(Optional.of("OK"))); }