SelectComponent { public void setup(List<SelectOption> options, Consumer<SelectOption> selectCallback) { this.setSelected(getFirstSelectOption(options)); this.setSelectOptions(options); this.callback = selectCallback; } @Inject  SelectComponent(final View view,
                           final ManagedInstance<SelectOptionComponent> selectOptionComponent); @PostConstruct void init(); void setup(List<SelectOption> options,
                      Consumer<SelectOption> selectCallback); void setSelected(SelectOption selected); SelectOption getSelected(); View getView();  }
@Test public void testSetup() { component.setup(Arrays.asList(option1), callback); verify(selectOptionComponent).initialize(eq(option1), any()); }
@Test public void testEmptySelectOptions() { component.setup(Arrays.asList(), callback); verify(selectOptionComponent, never()).initialize(eq(option1), any()); }