private static boolean findDeepestSuperOrSelfSignature(@NotNull PsiMethod method,
                                                         @NotNull Set<? super PsiMethod> set,
                                                         Set<? super PsiMethod> guard,
                                                         @NotNull Processor<? super PsiMethod> processor) {
    if (guard != null && !guard.add(method)) return true;
    PsiMethod[] supers = ReadAction.compute(() -> method.findSuperMethods());

    if (supers.length == 0 && set.add(method) && !processor.process(method)) {
      return false;
    }
    for (PsiMethod superMethod : supers) {
      if (guard == null) {
        guard = new HashSet<>();
        guard.add(method);
      }
      if (!findDeepestSuperOrSelfSignature(superMethod, set, guard, processor)) return false;
    }
    return true;
  }
private static boolean findDeepestSuperOrSelfSignature(@NotNull PsiMethod method,
                                                         @NotNull Set<? super PsiMethod> set,
                                                         Set<? super PsiMethod> guard,
                                                         @NotNull Processor<? super PsiMethod> processor)