private static void replaceWithAnnotation(@NotNull PsiModifierList modifierList,
                                            @NotNull PsiMethod method,
                                            @NotNull String annotationName) {
    final Optional<String> accessLevelFQN = LombokProcessorUtil.convertModifierToLombokAccessLevel(method);

    method.delete();

    PsiAnnotation addedAnnotation = modifierList.addAnnotation(annotationName);
    if (accessLevelFQN.isPresent()) {
      PsiExpression accessLevelExpression = PsiElementFactory.getInstance(modifierList.getProject())
        .createExpressionFromText(accessLevelFQN.get(), null);
      addedAnnotation.setDeclaredAttributeValue(PsiAnnotation.DEFAULT_REFERENCED_METHOD_NAME, accessLevelExpression);
    }
  }
private static void replaceWithAnnotation(@NotNull PsiModifierList modifierList,
                                            @NotNull PsiMethod method,
                                            @NotNull String annotationName)