Collection<PsiClass> (@NotNull PsiElement element, @NotNull PsiClass originClass) { Collection<PsiClass> weakestClasses = WeakestTypeFinder.calculateWeakestClassesNecessary(element, true); weakestClasses.remove(ClassUtils.findObjectClass(element)); if (onlyWeakentoInterface) { weakestClasses.removeIf(weakestClass -> !weakestClass.isInterface()); } weakestClasses = ContainerUtil.map(weakestClasses, psiClass -> tryReplaceWithParentStopper(originClass, psiClass, myStopClassSet)); return weakestClasses; }