public ContentPackInstallation installContentPack(ContentPack contentPack,
                                                      Map<String, ValueReference> parameters,
                                                      String comment,
                                                      String user) {
        if (contentPack instanceof ContentPackV1 contentPackV1) {
            return installContentPack(contentPackV1, parameters, comment, user);
        } else {
            throw new IllegalArgumentException("Unsupported content pack version: " + contentPack.version());
        }
    }
@Test
    public void installContentPackWithSystemStreamDependencies() throws Exception {
        ImmutableSet<Entity> entities = ImmutableSet.of(createTestViewEntity(), createTestEventDefinitionEntity());
        ContentPackV1 contentPack = ContentPackV1.builder()
                .description("test")
                .entities(entities)
                .name("test")
                .revision(1)
                .summary("")
                .vendor("")
                .url(URI.create("http://graylog.com"))
                .id(ModelId.of("dead-beef"))
                .build();

        for (String id : Stream.ALL_SYSTEM_STREAM_IDS) {
            when(streamService.load(id)).thenReturn(createTestStream(id));
        }
        when(userService.load(TEST_USER)).thenReturn(mockUser);
        when(searchDbService.save(any())).thenReturn(Search.builder().id("id").build());
        when(viewService.saveWithOwner(any(), any())).thenReturn(ViewDTO.builder().id("id").title("title").searchId("id").state(Collections.emptyMap()).build());
        when(eventDefinitionHandler.create(any(), any())).thenReturn(createTestEventDefinitionDto());

        contentPackService.installContentPack(contentPack, Collections.emptyMap(), "", TEST_USER);
    }