void () { final PsiElement elementAt = myFile.findElementAt(myEditor.getCaretModel().getOffset()); final XmlTag parentOfType = PsiTreeUtil.getParentOfType(elementAt, XmlTag.class); final XmlElementDescriptor descriptor = parentOfType.getDescriptor(); assertTrue("Rename of another func dcl failed",descriptor instanceof XmlElementDescriptorImpl && parentOfType.getLocalName().equals(descriptor.getName())); }