public static DataMap convertToDataMap(Map<String, Object> queryParams)
  {
    return convertToDataMap(queryParams, Collections.<String, Class<?>>emptyMap(),
        AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(),
        RestLiProjectionDataMapSerializer.DEFAULT_SERIALIZER);
  }
@Test
  public void testConvertToDataMap()
  {
    Map<String, Object> queryParams = new HashMap<>();

    Map<String, Object> hashMapParam = new HashMap<>();
    hashMapParam.put("someField", "someValue");
    hashMapParam.put("foo", "bar");
    hashMapParam.put("notifications", ImmutableMap.of("a", "b"));
    hashMapParam.put("type", Type.BOOLEAN);

    List<Object> subList = new ArrayList<>();
    subList.add("first");
    subList.add(ImmutableMap.of("x", "1", "y", 2));
    subList.add(ImmutableList.of(Type.ARRAY, Type.BYTES, Type.MAP));
    hashMapParam.put("subList", subList);

    List<Object> arrayListParam = new ArrayList<>();
    arrayListParam.add("x");
    arrayListParam.add("y");
    arrayListParam.add(hashMapParam);
    arrayListParam.add(Type.DOUBLE);

    queryParams.put("hashMapParam", hashMapParam);
    queryParams.put("arrayListParam", arrayListParam);

    DataMap dataMapQueryParams = QueryParamsUtil.convertToDataMap(queryParams);

    UriBuilder uriBuilder = new UriBuilder();
    URIParamUtils.addSortedParams(uriBuilder, dataMapQueryParams);
    String query = uriBuilder.build().getQuery();
    Assert.assertEquals(query,
        "arrayListParam=List(x,y,(foo:bar,notifications:(a:b),someField:someValue,subList:List(first,(x:1,y:2),List(ARRAY,BYTES,MAP)),type:BOOLEAN),DOUBLE)"
        + "&hashMapParam=(foo:bar,notifications:(a:b),someField:someValue,subList:List(first,(x:1,y:2),List(ARRAY,BYTES,MAP)),type:BOOLEAN)");
  }