### Question:
RequestUtils { public static List<String> getQueryStringParameterValues(HttpServletRequest request, String parameterName) { MultiValueMap<String, String> valueMap = getQueryStringParameters(request); return ((valueMap == null) || !valueMap.containsKey(parameterName)) ? null : valueMap.get(parameterName); }  static String getRemoteAddress(HttpServletRequest request); static String getRemoteAddress(); static void logRequestHeadersAndQueryParams(HttpServletRequest request, Logger logger); static MultiValueMap<String, String> getQueryStringParameters(HttpServletRequest request); static List<String> getQueryStringParameterValues(HttpServletRequest request, String parameterName); static String getQueryStringParameterValue(HttpServletRequest request, String parameterName);  }### Answer:
@Test public void testGetQueryStringParameterValues() { HttpServletRequest request = createMock(HttpServletRequest.class); expect(request.getQueryString()).andReturn(null).once(); expect(request.getQueryString()).andReturn("").once(); expect(request.getQueryString()).andReturn("p1=1").once(); expect(request.getQueryString()).andReturn("p1=1&p2=2").once(); expect(request.getQueryString()).andReturn("p1=1a&p2=2&p1=1b").once(); replayAll(); Assert.assertNull(RequestUtils.getQueryStringParameterValues(request, "p1")); Assert.assertNull(RequestUtils.getQueryStringParameterValues(request, "p1")); List<String> parameterValues; parameterValues = RequestUtils.getQueryStringParameterValues(request, "p1"); Assert.assertNotNull(parameterValues); Assert.assertEquals(1, parameterValues.size()); Assert.assertEquals("1", parameterValues.get(0)); parameterValues = RequestUtils.getQueryStringParameterValues(request, "p2"); Assert.assertNotNull(parameterValues); Assert.assertEquals(1, parameterValues.size()); Assert.assertEquals("2", parameterValues.get(0)); parameterValues = RequestUtils.getQueryStringParameterValues(request, "p1"); Assert.assertNotNull(parameterValues); Assert.assertEquals(2, parameterValues.size()); Assert.assertEquals("1a", parameterValues.get(0)); Assert.assertEquals("1b", parameterValues.get(1)); verifyAll(); }