public static boolean accepts(@NotNull PsiElement patternNode, @Nullable PsiElement matchNode) {
    if (patternNode instanceof LeafElement && matchNode instanceof LeafElement) {
      return ((LeafElement)patternNode).getElementType() == ((LeafElement)matchNode).getElementType();
    }
    return matchNode != null && patternNode.getClass() == matchNode.getClass();
  }
public static boolean accepts(@NotNull PsiElement patternNode, @Nullable PsiElement matchNode)