public Grok cachedGrokForPattern(String pattern) {
        return cachedGrokForPattern(pattern, false);
    }
@Test
    public void cachedGrokForPatternThrowsRuntimeException() {
        expectedException.expectMessage("No definition for key 'EMPTY' found, aborting");
        expectedException.expect(RuntimeException.class);
        expectedException.expectCause(Matchers.any(IllegalArgumentException.class));

        final Set<GrokPattern> newPatterns = Collections.singleton(GrokPattern.create("EMPTY", ""));
        when(grokPatternService.loadAll()).thenReturn(newPatterns);
        eventBus.post(GrokPatternsUpdatedEvent.create(Collections.singleton("EMPTY")));

        grokPatternRegistry.cachedGrokForPattern("%{EMPTY}");
    }