Scopes implements HttpFunction { @Override public void service(HttpRequest request, HttpResponse response) throws IOException { int functionVar = lightComputation(); var writer = new PrintWriter(response.getWriter()); writer.printf("Instance: %s; function: %s", INSTANCE_VAR, functionVar); }  @Override void service(HttpRequest request, HttpResponse response);  }
@Test public void scopesTest() throws IOException { new Scopes().service(request, response); writerOut.flush(); assertThat(responseOut.toString()).contains("Instance:"); }