void (PsiType psiType, Collection<Pair<PsiMethod, PsiSubstitutor>> results) { final PsiClassType.ClassResolveResult resolveResult = PsiUtil.resolveGenericsClassInType(psiType); final PsiClass psiClass = resolveResult.getElement(); if (null != psiClass && psiType instanceof PsiClassType psiClassType) { final PsiTypeParameter[] classTypeParameters = psiClass.getTypeParameters(); final PsiType[] parameters = psiClassType.getParameters(); PsiSubstitutor enrichedSubstitutor = PsiSubstitutor.EMPTY; if (classTypeParameters.length == parameters.length) { for (int i = 0; i < parameters.length; i++) { enrichedSubstitutor = enrichedSubstitutor.put(classTypeParameters[i], parameters[i]); } } for (Pair<PsiMethod, PsiSubstitutor> pair : psiClass.getAllMethodsAndTheirSubstitutors()) { final PsiMethod psiMethod = pair.getFirst(); if (isAcceptableMethod(psiMethod)) { final PsiSubstitutor psiSubstitutor = pair.getSecond().putAll(enrichedSubstitutor); if (!isAlreadyPresent(psiMethod, psiSubstitutor, results)) { results.add(Pair.pair(psiMethod, psiSubstitutor)); } } } } }