private static void checkForGetterSetter(final AtomicBoolean failBuild,
                                             final Path file,
                                             final String text,
                                             final String type,
                                             final String variable) {
        var capitalized = variable.substring(0, 1).toUpperCase(Locale.ENGLISH) + variable.substring(1);
        var patternAccess = Pattern.compile("(public|private|protected)\\s+"
            + type
            + "\\s+(get|set)" + capitalized
            + "\\(\\)\\s*\\{\\s*return (this\\.)*"
            + variable + ";\\s*\\}", Pattern.DOTALL);

        var accessMatcher = patternAccess.matcher(text);
        if (accessMatcher.find()) {
            print("%s should convert the getter/setter for variable [%s] to use Lombok's @Getter/@Setter", file, variable);
            failBuild.set(true);
        }
    }
This is {@link CheckEnforceLombokAnnotations}.

@author Misagh Moayyed
@since 6.3.0
ci/checks/CheckEnforceLombokAnnotations.java