void (@NotNull PsiField psiField) { PsiModifierList psiFieldModifierList = psiField.getModifierList(); if (null == psiFieldModifierList) { return; } // replace getter if it matches the requirements findGetterMethodToReplace(psiField).ifPresent( psiMethod -> replaceWithAnnotation(psiFieldModifierList, psiMethod, LombokClassNames.GETTER) ); // replace setter if it matches the requirements findSetterMethodToReplace(psiField).ifPresent( psiMethod -> replaceWithAnnotation(psiFieldModifierList, psiMethod, LombokClassNames.SETTER) ); }