@Override
    public Optional<NativeEntity<GrokPattern>> findExisting(Entity entity, Map<String, ValueReference> parameters) {
        if (entity instanceof EntityV1) {
            return findExisting((EntityV1) entity);
        } else {
            throw new IllegalArgumentException("Unsupported entity version: " + entity.getClass());
        }
    }
@Test
    public void findExistingFailsWithDivergingPatterns() throws ValidationException {
        grokPatternService.save(GrokPattern.create("Test", "[a-z]+"));
        final Entity grokPatternEntity = EntityV1.builder()
                .id(ModelId.of("1"))
                .type(ModelTypes.GROK_PATTERN_V1)
                .data(objectMapper.convertValue(GrokPatternEntity.create("Test", "BOOM"), JsonNode.class))
                .build();
        assertThatThrownBy(() -> facade.findExisting(grokPatternEntity, Collections.emptyMap()))
                .isInstanceOf(DivergingEntityConfigurationException.class)
                .hasMessage("Expected Grok pattern for name \"Test\": <BOOM>; actual Grok pattern: <[a-z]+>");
    }