@Override
    public Optional<NativeEntity<RuleDao>> findExisting(Entity entity, Map<String, ValueReference> parameters) {
        if (entity instanceof EntityV1) {
            return findExisting((EntityV1) entity, parameters);
        } else {
            throw new IllegalArgumentException("Unsupported entity version: " + entity.getClass());
        }
    }
@Test
    @MongoDBFixtures("PipelineRuleFacadeTest.json")
    public void findExistingWithDifferentSource() {
        final Entity entity = EntityV1.builder()
                .id(ModelId.of("debug"))
                .type(ModelTypes.PIPELINE_RULE_V1)
                .data(objectMapper.convertValue(PipelineRuleEntity.create(
                        ValueReference.of("debug"),
                        ValueReference.of("Debug"),
                        ValueReference.of("rule \"debug\"\nwhen\n  true\nthen\n\nend")), JsonNode.class))
                .build();
        assertThatThrownBy(() -> facade.findExisting(entity, Collections.emptyMap()))
                .isInstanceOf(DivergingEntityConfigurationException.class)
                .hasMessage("Different pipeline rule sources for pipeline rule with name \"debug\"");
    }