boolean (PsiElement element, PsiElement elementToMatchWith) { if (element == null || elementToMatchWith == null) { return false; } if (element.getClass() == elementToMatchWith.getClass()) { return false; } if (element.getFirstChild() == null && element.getTextLength() == 0 && !(element instanceof LeafElement)) { return true; } return false; }