### Question:
MakeRequestHandler { protected static String getParameter(HttpServletRequest request, String key, String defaultValue) { String ret = request.getParameter(key); return ret != null ? ret : defaultValue; } @Inject  MakeRequestHandler(RequestPipeline requestPipeline,
      ResponseRewriterRegistry contentRewriterRegistry); void fetch(HttpServletRequest request, HttpServletResponse response); static final String UNPARSEABLE_CRUFT; static final String POST_DATA_PARAM; static final String METHOD_PARAM; static final String HEADERS_PARAM; static final String CONTENT_TYPE_PARAM; static final String NUM_ENTRIES_PARAM; static final String DEFAULT_NUM_ENTRIES; static final String GET_SUMMARIES_PARAM; static final String GET_FULL_HEADERS_PARAM; static final String AUTHZ_PARAM; }### Answer:
@Test public void testGetParameter() { expect(request.getParameter("foo")).andReturn("bar"); replay(); assertEquals("bar", MakeRequestHandler.getParameter(request, "foo", "not foo")); }
@Test public void testGetParameterWithNullValue() { expect(request.getParameter("foo")).andReturn(null); replay(); assertEquals("not foo", MakeRequestHandler.getParameter(request, "foo", "not foo")); }