private static boolean addMethodUsages(@NotNull PsiClass aClass,
                                         @NotNull PsiManager manager,
                                         @NotNull JavaClassFindUsagesOptions options,
                                         @NotNull Processor<? super UsageInfo> processor) {
    if (options.isIncludeInherited) {
      PsiMethod[] methods = ReadAction.compute(() -> aClass.getAllMethods());
      for(int i = 0; i < methods.length; i++){
        PsiMethod method = methods[i];
        // filter overridden methods
        int finalI = i;
        PsiClass methodClass = ReadAction.compute(() -> {
          MethodSignature methodSignature = method.getSignature(PsiSubstitutor.EMPTY);
          for (int j = 0; j < finalI; j++) {
            if (methodSignature.equals(methods[j].getSignature(PsiSubstitutor.EMPTY))) return null;
          }
          return method.getContainingClass();
        });
        if (methodClass == null) continue;
        boolean equivalent = ReadAction.compute(() -> manager.areElementsEquivalent(methodClass, aClass));
        if (equivalent) {
          if (!addElementUsages(method, options, processor)) return false;
        }
        else {
          MethodReferencesSearch.SearchParameters parameters =
            new MethodReferencesSearch.SearchParameters(method, options.searchScope, true, options.fastTrack);
          boolean success = MethodReferencesSearch.search(parameters)
            .forEach(new PsiReferenceProcessorAdapter(reference -> {
              addResultFromReference(reference, methodClass, manager, aClass, options, processor);
              return true;
            }));
          if (!success) return false;
        }
      }
    }
    else {
      PsiMethod[] methods = ReadAction.compute(() -> aClass.getMethods());
      for (PsiMethod method : methods) {
        if (!addElementUsages(method, options, processor)) return false;
      }
    }
    return true;
  }
private static boolean addMethodUsages(@NotNull PsiClass aClass,
                                         @NotNull PsiManager manager,
                                         @NotNull JavaClassFindUsagesOptions options,
                                         @NotNull Processor<? super UsageInfo> processor)