### Question:
ClientFacesViewStateHandler implements FacesViewStateHandler { public void write(FacesContext facesContext, ViewArtifact viewState) throws IOException { HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest(); ResponseWriter writer = facesContext.getResponseWriter(); String value = encrypt(request, viewState.toString()); writeHiddenInput(writer, ID, value); }  void write(FacesContext facesContext, ViewArtifact viewState); ViewArtifact read(HttpServletRequest request);  }### Answer:
@Test public void shouldWrite() throws Exception { this.handler.write(this.facesContext, this.viewState); assertThat(this.output.toString(), startsWith("<input type=\"hidden\" " + "name=\"org.springframework.springfaces.id\" " + "id=\"org.springframework.springfaces.id\" " + "value=\"")); assertThat(this.output.toString(), endsWith("\"\\>")); }