@Override
    public Optional<NativeEntity<CacheDto>> 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("LookupCacheFacadeTest.json")
    public void findExisting() {
        final Entity entity = EntityV1.builder()
                .id(ModelId.of("1"))
                .type(ModelTypes.LOOKUP_CACHE_V1)
                .data(objectMapper.convertValue(LookupCacheEntity.create(
                        ValueReference.of(DefaultEntityScope.NAME),
                        ValueReference.of("no-op-cache"),
                        ValueReference.of("No-op cache"),
                        ValueReference.of("No-op cache"),
                        ReferenceMapUtils.toReferenceMap(ImmutableMap.of("type", "none"))
                ), JsonNode.class))
                .build();

        final NativeEntity<CacheDto> existingCache = facade.findExisting(entity, Collections.emptyMap())
                .orElseThrow(AssertionError::new);
        final NativeEntityDescriptor descriptor = existingCache.descriptor();
        final CacheDto cacheDto = existingCache.entity();

        assertThat(descriptor.id()).isEqualTo(ModelId.of("5adf24b24b900a0fdb4e52dd"));
        assertThat(descriptor.type()).isEqualTo(ModelTypes.LOOKUP_CACHE_V1);
        assertThat(cacheDto.id()).isEqualTo("5adf24b24b900a0fdb4e52dd");
        assertThat(cacheDto.name()).isEqualTo("no-op-cache");
        assertThat(cacheDto.title()).isEqualTo("No-op cache");
        assertThat(cacheDto.description()).isEqualTo("No-op cache");
        assertThat(cacheDto.config().type()).isEqualTo("none");
    }