@Override
    public Optional<GrokPattern> loadByName(String name) {
        final GrokPattern pattern = dbCollection.findOne(DBQuery.is("name", name));
        return Optional.ofNullable(pattern);
    }
@Test
    @MongoDBFixtures("MongoDbGrokPatternServiceTest.json")
    public void loadByNameWithExistingGrokPattern() {
        final Optional<GrokPattern> grokPattern = service.loadByName("Test1");
        assertThat(grokPattern)
                .isPresent()
                .hasValueSatisfying(p -> assertThat(p.name()).isEqualTo("Test1"))
                .hasValueSatisfying(p -> assertThat(p.pattern()).isEqualTo("[a-z]+"));
    }