private static boolean isParent(@NotNull PsiElement parent, @Nullable TreePath path) {
    return path != null && isElement(parent, path.getParentPath());
  }
private static boolean isParent(@NotNull PsiElement parent, @Nullable TreePath path)