@VisibleForTesting
  protected static Map<String, String[]> getQueryParameters(HttpServletRequest request) {
    Map<String, String[]> queryParameters = new HashMap<>();
    String queryString = request.getQueryString();

    if (StringUtils.isEmpty(queryString)) {
      return queryParameters;
    }

    String[] parameters = queryString.split("&");

    for (String parameter : parameters) {
      String[] keyValuePair = parameter.split("=");
      String[] values = queryParameters.get(keyValuePair[0]);
      values = ArrayUtils.add(values, keyValuePair.length == 1 ? "" : keyValuePair[1]); //length is one if no value is available.
      queryParameters.put(keyValuePair[0], values);
    }
    return queryParameters;
  }
@VisibleForTesting
  protected static Map<String, String[]> getQueryParameters(HttpServletRequest request) {
    Map<String, String[]> queryParameters = new HashMap<>();
    String queryString = request.getQueryString();

    if (StringUtils.isEmpty(queryString)) {
      return queryParameters;
    }

    String[] parameters = queryString.split("&");

    for (String parameter : parameters) {
      String[] keyValuePair = parameter.split("=");
      String[] values = queryParameters.get(keyValuePair[0]);
      values = ArrayUtils.add(values, keyValuePair.length == 1 ? "" : keyValuePair[1]); 
      queryParameters.put(keyValuePair[0], values);
    }
    return queryParameters;
  }
@ VisibleForTesting protected static Map < String , String [ ] > getQueryParameters ( HttpServletRequest request ) { Map < String , String [ ] > queryParameters = new HashMap <> ( ) ; String queryString = request . getQueryString ( ) ; if ( StringUtils . isEmpty ( queryString ) ) { return queryParameters ; } String [ ] parameters = queryString . split ( "&" ) ; for ( String parameter : parameters ) { String [ ] keyValuePair = parameter . split ( "=" ) ; String [ ] values = queryParameters . get ( keyValuePair [ 0 ] ) ; values = ArrayUtils . add ( values , keyValuePair . length == 1 ? "" : keyValuePair [ 1 ] ) ; //length is one if no value is available. queryParameters . put ( keyValuePair [ 0 ] , values ) ; } return queryParameters ; }
From https://stackoverflow.com/a/31928740/33905
From https : // stackoverflow . com / a / 31928740 / 33905