@SuppressWarnings("UnstableApiUsage")
    @Override
    public Graph<EntityDescriptor> resolveNativeEntity(EntityDescriptor entityDescriptor) {
        final MutableGraph<EntityDescriptor> mutableGraph = GraphBuilder.directed().build();
        mutableGraph.addNode(entityDescriptor);

        final ModelId modelId = entityDescriptor.id();
        final ViewDTO view = viewService.get(modelId.id()).
                orElseThrow(() -> new NoSuchElementException("Could not find view with id " + modelId.id()));
        view.resolveNativeEntity(entityDescriptor, mutableGraph);
        final ViewSummaryDTO viewSummaryDTO = viewSummaryService.get(modelId.id()).
                orElseThrow(() -> new NoSuchElementException("Could not find view with id " + modelId.id()));
        final Search search = searchDbService.get(viewSummaryDTO.searchId()).
                orElseThrow(() -> new NoSuchElementException("Could not find search with id " + viewSummaryDTO.searchId()));
        search.usedStreamIds().stream().map(s -> EntityDescriptor.create(s, ModelTypes.STREAM_REF_V1))
                .forEach(streamDescriptor -> mutableGraph.putEdge(entityDescriptor, streamDescriptor));
        search.resolveNativeEntity(entityDescriptor, mutableGraph);
        return ImmutableGraph.copyOf(mutableGraph);
    }
@Test
    @MongoDBFixtures("ViewFacadeTest.json")
    public void itShouldResolveDependencyForCreation() {
        final EntityDescriptor streamEntityDescriptor = EntityDescriptor.create(streamId, ModelTypes.STREAM_REF_V1);
        final EntityDescriptor viewEntityDescriptor = EntityDescriptor.create(viewId, ModelTypes.SEARCH_V1);
        Graph graph = facade.resolveNativeEntity(viewEntityDescriptor);

        assertThat(graph.nodes().toArray()).contains(streamEntityDescriptor);
    }