Set<PsiClass> () { PsiClass aClass = myClass; HashSet<PsiClass> result = new HashSet<>(); while (aClass != null && !myManager.areElementsEquivalent(aClass, myBaseClass)) { final PsiClassType[] implementsTypes = aClass.getImplementsListTypes(); for (PsiClassType implementsType : implementsTypes) { PsiClass resolved = implementsType.resolve(); if (resolved != null && !myManager.areElementsEquivalent(resolved, myBaseClass)) { result.add(resolved); InheritanceUtil.getSuperClasses(resolved, result, true); } } aClass = aClass.getSuperClass(); } return result; }