### Question:
FluentDriver extends AbstractFluentDriverSearchControl { @Override public EventsRegistry events() { return checkState(events, "An EventFiringWebDriver instance is required to use events. " + "You should set 'eventsEnabled' configuration property to 'true' " + "or override newWebDriver() to build an EventFiringWebDriver."); } FluentDriver(WebDriver driver, Configuration configuration, FluentControl adapter); Configuration getConfiguration(); @Override void takeHtmlDump(); @Override void takeHtmlDump(String fileName); @Override boolean canTakeScreenShot(); @Override void takeScreenshot(); @Override void takeScreenshot(String fileName); @Override WebDriver getDriver(); @Override AppiumDriver<?> getAppiumDriver(); @Override EventsRegistry events(); @Override MouseActions mouse(); @Override KeyboardActions keyboard(); @Override WindowAction window(); @Override FluentWait await(); @Override Set<Cookie> getCookies(); @Override Cookie getCookie(String name); @Override String url(); @Override String pageSource(); @Override P goTo(P page); @Override void goTo(String url); @Override void goToInNewTab(String url); @Override Capabilities capabilities(); @Override FluentJavascript executeScript(String script, Object... args); @Override FluentJavascript executeAsyncScript(String script, Object... args); @Override void switchTo(FluentList<? extends FluentWebElement> elements); @Override void switchTo(FluentWebElement element); @Override void switchTo(); @Override void switchToDefault(); @Override Alert alert(); void quit(); void releaseFluent(); @Override ContainerContext inject(Object container); @Override T newInstance(Class<T> cls); @Override ContainerContext injectComponent(Object componentContainer, Object parentContainer, SearchContext searchContext); @Override CssSupport css(); @Override PerformanceTiming performanceTiming(); @Override ChromiumApi getChromiumApi();  }### Answer:
@Test public void shouldThrowExceptionForEventsIfEventsRegistryIsNotSet() { fluentDriver = spy(new FluentDriver(webDriver, configuration, adapter)); assertThatIllegalStateException().isThrownBy(() -> fluentDriver.events()) .withMessageStartingWith("An EventFiringWebDriver instance is required to use events."); }