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 testMaskTreeProjectionParams()
  {
    Map<String, Object> queryParams = new HashMap<>();
    MaskMap fieldsMask = TestRecord.createMask().withId().withMessage();
    queryParams.put(RestConstants.FIELDS_PARAM, fieldsMask.getDataMap());
    DataMap pagingMask = new DataMap();
    pagingMask.put("paging", MaskMap.POSITIVE_MASK);
    queryParams.put(RestConstants.PAGING_FIELDS_PARAM, pagingMask);
    DataMap metaDataMask = new DataMap();
    metaDataMask.put("metadata", MaskMap.POSITIVE_MASK);
    queryParams.put(RestConstants.METADATA_FIELDS_PARAM, metaDataMask);

    DataMap dataMap =
        QueryParamsUtil.convertToDataMap(queryParams, Collections.emptyMap(),
            AllProtocolVersions.LATEST_PROTOCOL_VERSION, (paramName, pathSpecs) -> null);

    Assert.assertSame(dataMap.get(RestConstants.FIELDS_PARAM), fieldsMask.getDataMap());
    Assert.assertSame(dataMap.get(RestConstants.PAGING_FIELDS_PARAM), pagingMask);
    Assert.assertSame(dataMap.get(RestConstants.METADATA_FIELDS_PARAM), metaDataMask);

    UriBuilder uriBuilder = new UriBuilder();
    URIParamUtils.addSortedParams(uriBuilder, dataMap);
    String uri = uriBuilder.build().getQuery();
    Assert.assertEquals(uri, "fields=message,id&metadataFields=metadata&pagingFields=paging");
  }