private static void collectAllOwnMethods(@NotNull PsiExtensibleClass psiStartClass, Collection<Pair<PsiMethod, PsiSubstitutor>> results) {
    PsiExtensibleClass psiClass = psiStartClass;
    do {
      for (PsiMethod psiMethod : psiClass.getOwnMethods()) {
        if (isAcceptableMethod(psiMethod)) {
          if (!isAlreadyPresent(psiMethod, PsiSubstitutor.EMPTY, results)) {
            results.add(Pair.pair(psiMethod, PsiSubstitutor.EMPTY));
          }
        }
      }

      if (psiClass.getSuperClass() instanceof PsiExtensibleClass psiExtensibleSuperClass) {
        psiClass = psiExtensibleSuperClass;
      }
      else {
        psiClass = null;
      }
    }
    while (null != psiClass);
  }
private static void collectAllOwnMethods(@NotNull PsiExtensibleClass psiStartClass, Collection<Pair<PsiMethod, PsiSubstitutor>> results)