@Override
    public Graph<Entity> resolveForInstallation(Entity entity,
                                                Map<String, ValueReference> parameters,
                                                Map<EntityDescriptor, Entity> entities) {
        if (entity instanceof EntityV1) {
            return resolveForInstallationV1((EntityV1) entity, parameters, entities);
        } else {
            throw new IllegalArgumentException("Unsupported entity version: " + entity.getClass());
        }
    }
@Test
    @MongoDBFixtures("InputFacadeTest.json")
    public void resolveForInstallationGrokPattern() throws NotFoundException {
        final Input input = inputService.find("5ae2ebbeef27464477f0fd8b");
        final InputWithExtractors inputWithExtractors = InputWithExtractors.create(input, inputService.getExtractors(input));
        final GrokExtractor grokExtractor = (GrokExtractor) inputWithExtractors.extractors().iterator().next();
        final ExtractorEntity extractorEntity = ExtractorEntity.create(
                ValueReference.of(grokExtractor.getTitle()),
                ValueReference.of(grokExtractor.getType()),
                ValueReference.of(grokExtractor.getCursorStrategy()),
                ValueReference.of(grokExtractor.getTargetField()),
                ValueReference.of(grokExtractor.getSourceField()),
                ReferenceMapUtils.toReferenceMap(grokExtractor.getExtractorConfig()),
                Collections.emptyList(),
                ValueReference.of(grokExtractor.getConditionType()),
                ValueReference.of(grokExtractor.getConditionValue()),
                ValueReference.of(grokExtractor.getOrder()));
        List<ExtractorEntity> extractorEntities = new ArrayList<>(1);
        extractorEntities.add(extractorEntity);
        InputEntity inputEntity = InputEntity.create(
                ValueReference.of(input.getTitle()),
                ReferenceMapUtils.toReferenceMap(input.getConfiguration()),
                Collections.emptyMap(),
                ValueReference.of(input.getType()),
                ValueReference.of(input.isGlobal()),
                extractorEntities);
        Entity entity = EntityV1.builder()
                .id(ModelId.of(input.getId()))
                .type(ModelTypes.INPUT_V1)
                .data(objectMapper.convertValue(inputEntity, JsonNode.class))
                .build();
        final GrokPatternEntity grokPatternEntity = GrokPatternEntity.create("GREEDY", ".*");
        final Entity expectedEntity = EntityV1.builder()
                .id(ModelId.of("dead-feed"))
                .data(objectMapper.convertValue(grokPatternEntity, JsonNode.class))
                .type(ModelTypes.GROK_PATTERN_V1)
                .build();
        final EntityDescriptor entityDescriptor = expectedEntity.toEntityDescriptor();
        final Map<EntityDescriptor, Entity> entities = new HashMap<>(1);
        entities.put(entityDescriptor, expectedEntity);
        Graph<Entity> graph = facade.resolveForInstallation(entity, Collections.emptyMap(), entities);
        assertThat(graph.nodes()).contains(expectedEntity);
    }