PsiMethod (@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation, boolean hasCanEqualMethod) { final PsiManager psiManager = psiClass.getManager(); final LombokLightMethodBuilder methodBuilder = new LombokLightMethodBuilder(psiManager, EQUALS_METHOD_NAME) .withModifier(PsiModifier.PUBLIC) .withMethodReturnType(PsiTypes.booleanType()) .withContainingClass(psiClass) .withNavigationElement(psiAnnotation) .withFinalParameter("o", PsiType.getJavaLangObject(psiManager, psiClass.getResolveScope())); LombokLightParameter parameter = methodBuilder.getParameterList().getParameter(0); if (null != parameter) { LombokAddNullAnnotations.createRelevantNullableAnnotation(psiClass, parameter); copyOnXAnnotationsForFirstParam(psiAnnotation, parameter); } methodBuilder.withBodyText(m -> { PsiClass containingClass = m.getContainingClass(); PsiAnnotation anno = (PsiAnnotation)m.getNavigationElement(); return createEqualsBlockString(containingClass, anno, hasCanEqualMethod, EqualsAndHashCodeToStringHandler.filterMembers(containingClass, anno, true, INCLUDE_ANNOTATION_METHOD, null, EQUALS_AND_HASHCODE_INCLUDE, EQUALS_AND_HASHCODE_EXCLUDE)); }); return methodBuilder; }