### Question:
HTTPUtilitiesImplementation implements HTTPUtilities { public List<String> valuesFromBodyURI(final String tokenName) throws GrinderException { return valuesFromBodyURI(tokenName, null); } HTTPUtilitiesImplementation(PluginProcessContext processContext); NVPair basicAuthorizationHeader(String userID, String password); HTTPResponse getLastResponse(); String valueFromLocationURI(final String tokenName); String valueFromBodyInput(final String tokenName); String valueFromBodyInput(String tokenName, String afterText); List<String> valuesFromBodyInput(final String tokenName); List<String> valuesFromBodyInput(String tokenName, String afterText); String valueFromHiddenInput(final String tokenName); String valueFromHiddenInput(String tokenName, String afterText); List<String> valuesFromHiddenInput(final String tokenName); List<String> valuesFromHiddenInput(String tokenName, String afterText); String valueFromBodyURI(final String tokenName); String valueFromBodyURI(final String tokenName, String afterText); List<String> valuesFromBodyURI(final String tokenName); List<String> valuesFromBodyURI(final String tokenName,
                                        String afterText);  }### Answer:
@Test public void testValuesFromBodyURI() throws Exception { final HTTPRequest request = new HTTPRequest(); final HTTPUtilities httpUtilities = new HTTPUtilitiesImplementation(m_pluginProcessContext); assertEquals(emptyList(), httpUtilities.valuesFromBodyURI("foo")); final HTTPRequestHandler handler = new HTTPRequestHandler(); handler.start(); request.GET(handler.getURL()); assertEquals(emptyList(), httpUtilities.valuesFromBodyURI("foo")); handler.setBody( "<body><a href='http: request.GET(handler.getURL()); assertEquals(emptyList(), httpUtilities.valuesFromBodyURI("foo")); handler.setBody( "<body><a href='http: request.GET(handler.getURL()); assertEquals(singletonList("bah"), httpUtilities.valuesFromBodyURI("foo")); assertEquals(emptyList(), httpUtilities.valuesFromBodyURI("bah")); handler.setBody( "<body><a href='http: request.GET(handler.getURL()); assertEquals(singletonList(""), httpUtilities.valuesFromBodyURI("foo")); assertEquals(singletonList("dah"), httpUtilities.valuesFromBodyURI("lah")); handler.setBody( "<body><a href='http: "<a href='http: request.GET(handler.getURL()); assertEquals(asList("1234", "5678"), httpUtilities.valuesFromBodyURI("JSESSIONID")); assertEquals(emptyList(), httpUtilities.valuesFromBodyURI("foo")); handler.addHeader("Content-Type", "garbage"); request.GET(handler.getURL()); assertEquals(asList("1234", "5678"), httpUtilities.valuesFromBodyURI("JSESSIONID")); assertEquals(emptyList(), httpUtilities.valuesFromBodyURI("foo")); assertEquals(asList("1234", "5678"), httpUtilities.valuesFromBodyURI("JSESSIONID", "<body>")); assertEquals(asList("5678"), httpUtilities.valuesFromBodyURI("JSESSIONID", "</a>")); assertEquals(emptyList(), httpUtilities.valuesFromBodyURI("JSESSIONID", "5")); assertEquals(emptyList(), httpUtilities.valuesFromBodyURI("JSESSIONID", "999")); handler.shutdown(); }