boolean (@NotNull PsiClass aClass) { Set<PsiClass> visited = new HashSet<>(); Queue<PsiClass> queue = ContainerUtil.newLinkedList(aClass); while (!queue.isEmpty()) { PsiClass current = queue.remove(); if (current instanceof ClsClassImpl) continue; if (visited.add(current)) { for (PsiClass superClass : getSupers(current, false)) { queue.offer(superClass); } } else if (!current.isInterface() && !CommonClassNames.JAVA_LANG_OBJECT.equals(current.getQualifiedName())) { return false; } } return true; }