void (@NotNull PsiClass psiClass) { final PsiElementFactory factory = JavaPsiFacade.getElementFactory(psiClass.getProject()); final PsiClassType stringClassType = factory.createTypeByFQClassName(CommonClassNames.JAVA_LANG_STRING, psiClass.getResolveScope()); final PsiMethod toStringMethod = findPublicNonStaticMethod(psiClass, "toString", stringClassType); if (null != toStringMethod) { toStringMethod.delete(); } addAnnotation(psiClass, LombokClassNames.TO_STRING); }