List<XmlTag> (final DomInvocationHandler handler, final XmlTag[] subTags, final XmlFile file) { if (subTags.length == 0) { return Collections.emptyList(); } final DomGenericInfoEx info = handler.getGenericInfo(); final Set<XmlName> usedNames = new HashSet<>(); List<? extends DomCollectionChildDescription> collectionChildrenDescriptions = info.getCollectionChildrenDescriptions(); //noinspection ForLoopReplaceableByForEach for (int i = 0, size = collectionChildrenDescriptions.size(); i < size; i++) { DomCollectionChildDescription description = collectionChildrenDescriptions.get(i); usedNames.add(description.getXmlName()); } List<? extends DomFixedChildDescription> fixedChildrenDescriptions = info.getFixedChildrenDescriptions(); //noinspection ForLoopReplaceableByForEach for (int i = 0, size = fixedChildrenDescriptions.size(); i < size; i++) { DomFixedChildDescription description = fixedChildrenDescriptions.get(i); usedNames.add(description.getXmlName()); } return ContainerUtil.findAll(subTags, tag -> { if (StringUtil.isEmpty(tag.getLocalName())) return false; for (final XmlName name : usedNames) { if (isNameSuitable(name, tag, handler, file)) { return false; } } return true; }); }