HttpServletRequestParams { public static boolean getBool(HttpServletRequest request, String param, boolean defaultValue) { if (request.getParameter(param) != null) { return Boolean.valueOf(request.getParameter(param)); } else { return defaultValue; } }  static int getInt(HttpServletRequest request, String param, int defaultValue); static long getLong(HttpServletRequest request, String param, long defaultValue); static boolean getBool(HttpServletRequest request, String param, boolean defaultValue); @Nullable static String getString(HttpServletRequest request, String param,
                                 @Nullable String defaultValue);  }
@Test public void testGetBoolParam() { EasyMock.replay(request); assertEquals(false, HttpServletRequestParams.getBool(request, INT_PARAM, true)); assertEquals(false, HttpServletRequestParams.getBool(request, LONG_PARAM, false)); assertEquals(true, HttpServletRequestParams.getBool(request, BOOL_PARAM, false)); }