private static boolean reachableInHierarchy(Set<PsiClass> forbidden, GrTypeDefinition root) {
    for (PsiClass aSuper : root.getSupers(false)) {
      if (forbidden.contains(aSuper)) {
        return true;
      }
      forbidden.add(aSuper);
      if (aSuper instanceof GrTypeDefinition && reachableInHierarchy(forbidden, (GrTypeDefinition)aSuper)) {
        return true;
      }
    }
    return false;
  }
private static boolean reachableInHierarchy(Set<PsiClass> forbidden, GrTypeDefinition root)