List<Duplicate> (@NotNull List<? extends DuplicateNode> allNodes, @NotNull Set<? extends DuplicateNode> selectedNodes, @NotNull PsiFile copyFile) { List<Duplicate> excludedRanges = new ArrayList<>(); for (DuplicateNode node : allNodes) { if (selectedNodes.contains(node)) { continue; } ElementsRange elementsRange = node.getElementsRange(); if (elementsRange != null) { ElementsRange copyRange = elementsRange.findCopyInFile(copyFile); if (copyRange != null) { excludedRanges.add(new Duplicate(node, copyRange)); } } } return excludedRanges; }