HttpServletRequestParams { @Nullable public static String getString(HttpServletRequest request, String param, @Nullable String defaultValue) { if (request.getParameter(param) != null) { return 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 testGetStringParam() { EasyMock.replay(request); assertEquals("123", HttpServletRequestParams.getString(request, INT_PARAM, "default")); assertEquals("260833376896966656", HttpServletRequestParams.getString(request, LONG_PARAM, "default")); assertEquals("asdf", HttpServletRequestParams.getString(request, STRING_PARAM, "default")); assertEquals("default", HttpServletRequestParams.getString(request, UNSET_PARAM, "default")); }