### Question:
LifecycleAccessor implements ServletContextAware { public Lifecycle getLifecycle() { Assert.state(this.servletContext != null, "ServletContext has not been set"); if (this.cachedLifecycle == null) { String lifecycleIdToUse = this.lifecycleId; LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder .getFactory(FactoryFinder.LIFECYCLE_FACTORY); if (lifecycleIdToUse == null) { lifecycleIdToUse = this.servletContext.getInitParameter(FacesServlet.LIFECYCLE_ID_ATTR); } if (lifecycleIdToUse == null) { lifecycleIdToUse = LifecycleFactory.DEFAULT_LIFECYCLE; } this.cachedLifecycle = lifecycleFactory.getLifecycle(lifecycleIdToUse); } return this.cachedLifecycle; }  void setServletContext(ServletContext servletContext); Lifecycle getLifecycle(); void setLifecycleId(String lifecycleId);  }### Answer:
@Test public void shouldNeedServletContext() throws Exception { this.thrown.expect(IllegalStateException.class); this.thrown.expectMessage("ServletContext has not been set"); this.lifecycleAccessor.getLifecycle(); }