boolean (final PsiMember psiMember, final Set<PsiMember> underConsideration, final Map<PsiClass, Map<PsiMethod, List<String>>> results) { boolean result = false; final PsiClass psiClass = psiMember instanceof PsiClass ? ((PsiClass)psiMember) : psiMember.getContainingClass(); Map<PsiMethod, List<String>> psiMethods = results.get(psiClass); if (psiMethods == null) { psiMethods = new LinkedHashMap<>(); results.put(psiClass, psiMethods); if (psiMember instanceof PsiClass) { result = underConsideration.add(psiMember); } } if (psiMember instanceof PsiMethod) { final boolean add = psiMethods.put((PsiMethod)psiMember, Collections.emptyList()) != null; if (add) { return underConsideration.add(psiMember); } return false; } return result; }