}
private void addMethodsOfType(PsiType psiType, Collection<Pair<PsiMethod, PsiSubstitutor>> allMethods) {
PsiClassType.ClassResolveResult classResolveResult = PsiUtil.resolveGenericsClassInType(psiType);
if (null != classResolveResult) {
PsiClass psiClass = classResolveResult.getElement();
PsiSubstitutor classSubstitutor = classResolveResult.getSubstitutor();
if (null != psiClass) {
List<Pair<PsiMethod, PsiSubstitutor>> methodsAndTheirSubstitutors = psiClass.getAllMethodsAndTheirSubstitutors();
for (Pair<PsiMethod, PsiSubstitutor> pair : methodsAndTheirSubstitutors) {
PsiMethod psiMethod = pair.getFirst();
if (!psiMethod.isConstructor() && psiMethod.hasModifierProperty(PsiModifier.PUBLIC) && !psiMethod.hasModifierProperty(PsiModifier.STATIC)) {
// replace Substitutor, one from pair seems to be wrong?
allMethods.add(new Pair<PsiMethod, PsiSubstitutor>(psiMethod, classSubstitutor));