@Override
    public Map<String, String> loadStreamTitles(Collection<String> streamIds) {
        if (streamIds.isEmpty()) {
            return Map.of();
        }

        final var streamObjectIds = streamIds.stream().map(ObjectId::new).toList();
        final var cursor = collection(StreamImpl.class).find(
                new BasicDBObject("_id", new BasicDBObject("$in", streamObjectIds)),
                new BasicDBObject("_id", 1).append("title", 1)
        );
        try (cursor) {
            return cursorToList(cursor).stream()
                    .collect(Collectors.toMap(i -> i.get("_id").toString(), i -> i.get("title").toString()));
        }
    }
@Test
    @MongoDBFixtures("someStreamsWithAlertConditions.json")
    public void loadStreamTitles() {
        final var result = streamService.loadStreamTitles(Set.of("565f02223b0c25a537197af2", "559d14663b0cf26a15ee0f01"));

        assertThat(result).hasSize(2);
        assertThat(result.get("565f02223b0c25a537197af2")).isEqualTo("Logins");
        assertThat(result.get("559d14663b0cf26a15ee0f01")).isEqualTo("footitle");

        assertThat(streamService.loadStreamTitles(Set.of())).isEmpty();

        // Invalid ObjectIds throw an error
        assertThatThrownBy(() -> streamService.loadStreamTitles(Set.of("foo")))
                .isInstanceOf(IllegalArgumentException.class);
        assertThatThrownBy(() -> streamService.loadStreamTitles(Collections.singleton(null)))
                .isInstanceOf(IllegalArgumentException.class);
        assertThatThrownBy(() -> streamService.loadStreamTitles(Collections.singleton("")))
                .isInstanceOf(IllegalArgumentException.class);
    }