### Question:
WebContextServlet extends HttpServlet { void writeWebResources( PrintWriter writer, List<String> resources ) { resources.stream().forEach( location -> { if ( location.startsWith( "/" ) ) { location = location.substring( 1 ); } writeDocumentWriteResource( writer, location ); } ); }  void setRequireWaitTime( Integer value ); Integer getRequireWaitTime(); void setServicesRoot( String value ); String getServicesRoot(); @Override void destroy(); void addPlatformWebResource( IPlatformWebResource resource ); void removePlatformWebResource( IPlatformWebResource resource );  }### Answer:
@Test public void testWriteWebResourcesJSToDoc() throws Exception { List<String> resources = new ArrayList<>(); resources.add( "scripts/includeMe.js" ); resources.add( "scripts/includeMeToo.js" ); PrintWriter writer = new PrintWriter( this.mockResponseOutputStream ); this.webContextServlet.writeWebResources( writer, resources ); String response = getServletResponse( writer ); resources.forEach( resource -> { String expected = getDocumentWriteExpected( resource ); assertTrue( response.contains( expected ) ); } ); }
@Test public void testWriteWebResourcesCssToDoc() throws Exception { List<String> resources = new ArrayList<>(); resources.add( "styles/awesome.css" ); PrintWriter writer = new PrintWriter( this.mockResponseOutputStream ); this.webContextServlet.writeWebResources( writer, resources ); String response = getServletResponse( writer ); resources.forEach( resource -> { String expected = getDocumentWriteExpected( resource ); assertTrue( response.contains( expected ) ); } ); }