@Test public void testGetSelectedItems() { when(itemThree.getIsSelected()).thenReturn(true); final List<TreeListItem> selectedItems = treeList.getSelectedItems(); assertTrue(selectedItems.contains(itemThree)); assertFalse(selectedItems.contains(itemOne)); assertFalse(selectedItems.contains(itemTwo)); }
public List<TreeListItem> getSelectedItems() { return getCurrentItems().stream() .filter(item -> item.getIsSelected()) .collect(Collectors.toList()); }
TreeList { public List<TreeListItem> getSelectedItems() { return getCurrentItems().stream() .filter(item -> item.getIsSelected()) .collect(Collectors.toList()); } }
TreeList { public List<TreeListItem> getSelectedItems() { return getCurrentItems().stream() .filter(item -> item.getIsSelected()) .collect(Collectors.toList()); } @Inject  TreeList(final View view); }
TreeList { public List<TreeListItem> getSelectedItems() { return getCurrentItems().stream() .filter(item -> item.getIsSelected()) .collect(Collectors.toList()); } @Inject  TreeList(final View view); void populate(final List<TreeListItem> items); void refresh(); List<TreeListItem> getCurrentItems(); void clear(); Node getElement(); void clearSelection(); List<TreeListItem> getSelectedItems(); void setOnSelectionChanged(final Consumer<List<TreeListItem>> onSelectionChanged); }
TreeList { public List<TreeListItem> getSelectedItems() { return getCurrentItems().stream() .filter(item -> item.getIsSelected()) .collect(Collectors.toList()); } @Inject  TreeList(final View view); void populate(final List<TreeListItem> items); void refresh(); List<TreeListItem> getCurrentItems(); void clear(); Node getElement(); void clearSelection(); List<TreeListItem> getSelectedItems(); void setOnSelectionChanged(final Consumer<List<TreeListItem>> onSelectionChanged);  }