@Override
    public JFieldVar apply(String nodeName, JsonNode node, JsonNode parent, JFieldVar field, Schema currentSchema) {

        if (ruleFactory.getGenerationConfig().isIncludeJsr303Annotations() && isApplicableType(field)) {
            final Class<? extends Annotation> patternClass
                    = ruleFactory.getGenerationConfig().isUseJakartaValidation()
                    ? Pattern.class
                    : javax.validation.constraints.Pattern.class;
            JAnnotationUse annotation = field.annotate(patternClass);
            annotation.param("regexp", node.asText());
        }

        return field;
    }
@Test
    public void testRegex() {
        when(config.isIncludeJsr303Annotations()).thenReturn(true);
        final String patternValue = "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$";

        when(node.asText()).thenReturn(patternValue);
        when(fieldVar.annotate(patternClass)).thenReturn(annotation);
        when(fieldVar.type().boxify().fullName()).thenReturn(fieldClass.getTypeName());

        JFieldVar result = rule.apply("node", node, null, fieldVar, null);
        assertSame(fieldVar, result);

        verify(fieldVar, times(isApplicable ? 1 : 0)).annotate(patternClass);
        verify(annotation, times(isApplicable ? 1 : 0)).param("regexp", patternValue);
    }