void (@NotNull PsiMethod method) { final PsiClass containingClass = method.getContainingClass(); final ClassAccessVisitor visitor = new ClassAccessVisitor(containingClass); method.accept(visitor); final Set<PsiClass> overAccessedClasses = visitor.getOveraccessedClasses(); for (PsiClass aClass : overAccessedClasses) { registerMethodError(method, aClass, method); } }