List<String> (final Collection<String> all) { // i.e. all-[all used] final List<String> result = new LinkedList<>(all); for (int i = 0; i < myRoot.getChildCount(); i++) { final MyNode node = (MyNode) myRoot.getChildAt(i); final GroupConfigurable groupConfigurable = (GroupConfigurable) node.getConfigurable(); if (! groupConfigurable.getEditableObject().isDefault()) { result.removeAll(groupConfigurable.getRepositories()); } } return result; }