### Question:
FacesHandlerInterceptor extends HandlerInterceptorAdapter implements ServletContextAware { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if (handler instanceof Postback) { handler = ((Postback) handler).getHandler(); } WebApplicationContext webApplicationContext = RequestContextUtils.getWebApplicationContext(request, this.servletContext); initializeSpringFacesContext(this.lifecycleAccessor, webApplicationContext, request, response, handler); return true; }  void setServletContext(ServletContext servletContext); @Override boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler); @Override void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex); void setLifecycleId(String lifecycleId);  }### Answer:
@Test public void shouldPreHandlerNonPostback() throws Exception { boolean proceed = this.interceptor.preHandle(this.request, this.response, this.handler); assertThat(proceed, is(true)); assertThat(this.initializedSpringFacesContextHandler, is(sameInstance(this.handler))); }
@Test public void shouldPreHandlePostback() throws Exception { ViewArtifact viewArtifact = new ViewArtifact("test"); Postback postback = new Postback(viewArtifact, this.handler); boolean proceed = this.interceptor.preHandle(this.request, this.response, postback); assertThat(proceed, is(true)); assertThat(this.initializedSpringFacesContextHandler, is(sameInstance(this.handler))); }