@JsonCreator
    public static StageSource create(@JsonProperty("stage") @Min(0) int stage,
                                     @JsonProperty("match") @Nullable Stage.Match match,
                                     @JsonProperty("rules") List<String> rules) {
        return builder()
                .stage(stage)
                .match(match)
                .rules(rules)
                .build();
    }
@Test
    public void testSerialization() throws Exception {
        final StageSource stageSource = StageSource.create(23, Stage.Match.ALL, Collections.singletonList("some-rule"));
        final JsonNode json = objectMapper.convertValue(stageSource, JsonNode.class);

        assertThat(json.path("stage").asInt()).isEqualTo(23);
        assertThat(json.path("match").asText()).isEqualTo("ALL");
        assertThat(json.path("rules").isArray()).isTrue();
        assertThat(json.path("rules")).hasSize(1);
        assertThat(json.path("rules").get(0).asText()).isEqualTo("some-rule");
    }