public Optional<ContentPack> insert(final ContentPack pack) {
        if (findByIdAndRevision(pack.id(), pack.revision()).isPresent()) {
            LOG.debug("Content pack already found: id: {} revision: {}. Did not insert!", pack.id(), pack.revision());
            return Optional.empty();
        }
        final WriteResult<ContentPack, ObjectId> writeResult = dbCollection.insert(pack);
        return Optional.of(writeResult.getSavedObject());
    }
@Test
    public void insertDuplicate() {
        final ContentPackV1 contentPack = ContentPackV1.builder()
                .id(ModelId.of("id"))
                .revision(1)
                .name("name")
                .description("description")
                .summary("summary")
                .vendor("vendor")
                .url(URI.create("https://www.graylog.org/"))
                .entities(ImmutableSet.of())
                .build();
        contentPackPersistenceService.insert(contentPack);

        final Optional<ContentPack> savedContentPack2 = contentPackPersistenceService.insert(contentPack);
        assertThat(savedContentPack2)
                .isEmpty();
    }