@Override
    public GrokPattern load(String patternId) throws NotFoundException {
        final GrokPattern pattern = dbCollection.findOneById(new ObjectId(patternId));
        if (pattern == null) {
            throw new NotFoundException("Couldn't find Grok pattern with ID " + patternId);
        }
        return pattern;
    }
@Test
    public void loadNonExistentGrokPatternThrowsNotFoundException() {
        assertThatThrownBy(() -> service.load("cafebabe00000000deadbeef"))
                .isInstanceOf(NotFoundException.class);
    }