boolean (PsiElement[] elements) { final Set<String> names = new HashSet<>(); for (PsiElement element : elements) { if (element instanceof XmlTag) { final String name = ((XmlTag)element).getName(); if (!names.add(name)) { return true; } } } return false; }