MenuEntryWidget extends Composite implements MenuEntry, ClickHandler { @Override public void onClick(@NotNull ClickEvent event) { image.getElement().setInnerHTML(isSplitterHidden ? icon.toString() : ""); delegate.onEntryClicked(isSplitterHidden); isSplitterHidden = !isSplitterHidden; } @Inject  MenuEntryWidget(RunnerResources resources, @NotNull @Assisted String entryName); @Override void onClick(@NotNull ClickEvent event); @Override void setDelegate(@NotNull ActionDelegate delegate);  }
@Test public void onEntryShouldBeClicked() { menuEntry.onClick(event); verify(menuEntry.image).getElement(); verify(delegate).onEntryClicked(true); menuEntry.onClick(event); verify(delegate).onEntryClicked(false); }