List<NamedScope> () { Set<String> usedNames = getUsedScopeNames(); List<NamedScope> namedScopes = new ArrayList<>(); for (NamedScopesHolder holder : getScopeHolders()) { for (NamedScope scope : holder.getEditableScopes()) { if (!usedNames.contains(scope.getScopeId())) { namedScopes.add(scope); } } } return namedScopes; }