@Test public void testCallOnIsSelectedChanged() { final Consumer consumer = mock(Consumer.class); doReturn(consumer).when(treeListItem).getOnIsSelectedChanged(); treeListItem.callOnIsSelectedChanged(); verify(consumer).accept(treeListItem); }
void callOnIsSelectedChanged() { if (!Objects.isNull(getOnIsSelectedChanged())) { getOnIsSelectedChanged().accept(this); } }
TreeListItem { void callOnIsSelectedChanged() { if (!Objects.isNull(getOnIsSelectedChanged())) { getOnIsSelectedChanged().accept(this); } } }
TreeListItem { void callOnIsSelectedChanged() { if (!Objects.isNull(getOnIsSelectedChanged())) { getOnIsSelectedChanged().accept(this); } } @Inject  TreeListItem(final View view); }
TreeListItem { void callOnIsSelectedChanged() { if (!Objects.isNull(getOnIsSelectedChanged())) { getOnIsSelectedChanged().accept(this); } } @Inject  TreeListItem(final View view); Node getElement(); String getDescription(); void setDescription(final String description); void addSubItem(final TreeListSubItem subItem); List<TreeListSubItem> getSubItems(); void updateView(); void setIsSelected(final boolean value); boolean getIsSelected(); void setDataSource(final DataObject dataSource); DataObject getDataSource(); void setOnIsSelectedChanged(final Consumer<TreeListItem> onIsSelectedChanged); Consumer<TreeListItem> getOnIsSelectedChanged(); }
TreeListItem { void callOnIsSelectedChanged() { if (!Objects.isNull(getOnIsSelectedChanged())) { getOnIsSelectedChanged().accept(this); } } @Inject  TreeListItem(final View view); Node getElement(); String getDescription(); void setDescription(final String description); void addSubItem(final TreeListSubItem subItem); List<TreeListSubItem> getSubItems(); void updateView(); void setIsSelected(final boolean value); boolean getIsSelected(); void setDataSource(final DataObject dataSource); DataObject getDataSource(); void setOnIsSelectedChanged(final Consumer<TreeListItem> onIsSelectedChanged); Consumer<TreeListItem> getOnIsSelectedChanged();  }