List<SvnChangeList> () { Set<Long> selected = myWiseSelection.getSelected(); Set<Long> unselected = myWiseSelection.getUnselected(); // todo: can be made faster Condition<SvnChangeList> filter = myWiseSelection.areAllSelected() ? list -> !unselected.contains(list.getNumber()) : list -> selected.contains(list.getNumber()); return filter(myRevisionsModel.getItems(), filter); }