AddAttributeWidget implements IsWidget { public void init(final RuleModeller ruleModeller) { this.ruleModeller = ruleModeller; ((Image) asWidget()).addClickHandler(event -> showAttributeSelectorPopup()); } AddAttributeWidget(); void init(final RuleModeller ruleModeller); @Override Widget asWidget(); void showAttributeSelectorPopup();  }
@Test public void testInit() { addAttributeWidget.init(ruleModeller); verify(addImage).addClickHandler(clickHandlerArgumentCaptor.capture()); clickHandlerArgumentCaptor.getValue().onClick(null); verify(addAttributeWidget).showAttributeSelectorPopup(); }