Utils { static String[] parseKeyValuePair(String decoded) { if (decoded == null) { return null; } int idx = decoded.indexOf("="); if (idx < 0) { return new String[] { decoded }; } else { return new String[] { decoded.substring(0, idx), decoded.substring(idx + 1) }; } }  static String getReferer(HttpServletRequest request); static String getRefererSendError(HttpServletRequest request, HttpServletResponse response); static Map<String, String> getParametersAndReferer(HttpServletRequest request, HttpServletResponse response,
        boolean exceptionIfRefererMissing); static String urlEncode(String string); static String urlDecode(String string); static Map<String, String> extractSlashedEncodedParametersFromUri(HttpServletRequest request,
        String serviceUrlPattern); static void sendQRCode(HttpServletRequest request, HttpServletResponse response, String contents); static void sendQRCode(HttpServletRequest request, HttpServletResponse response, String contents,
        MatrixToImageConfig config, Dimension dimension); static MatrixToImageConfig getMatrixToImageConfig(HttpServletRequest request); static String getRequestInfosForLog(HttpServletRequest request); static String getServletMappingUrlPattern(HttpServletRequest request, String servletName); final static String QR_ON_COLOR; final static String QR_OFF_COLOR; final static int QR_ON_COLOR_DEFAULT; final static int QR_OFF_COLOR_DEFAULT; }
@Test public void testParseKeyValuePair() { testParseKeyValuePairCheck(null, true, 0); testParseKeyValuePairCheck("", false, 1, ""); testParseKeyValuePairCheck("xyz", false, 1, "xyz"); testParseKeyValuePairCheck("abc=xyz", false, 2, "abc", "xyz"); testParseKeyValuePairCheck("=xyz", false, 2, "", "xyz"); testParseKeyValuePairCheck("abc=", false, 2, "abc", ""); testParseKeyValuePairCheck("=", false, 2, "", ""); testParseKeyValuePairCheck("abc=xyz=hij", false, 2, "abc", "xyz=hij"); }