private static void diagnoseNullParent(TreeElement cur) {
    PsiElement psi = cur.getPsi();
    if (psi != null) {
      PsiUtilCore.ensureValid(psi);
    }
    throw new IllegalStateException("Null parent of " + cur + " " + cur.getClass());
  }
private static void diagnoseNullParent(TreeElement cur)