public static void addSortedParams(UriBuilder uriBuilder, DataMap params, ProtocolVersion version)
  {
    if(version.compareTo(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion()) >= 0)
    {
      addSortedParams(uriBuilder, params);
    }
    else
    {
      QueryParamsDataMap.addSortedParams(uriBuilder, params);
    }
  }
@Test
  public void addSortedParams()
  {
    DataMap queryParams = new DataMap();
    DataMap aParamMap = new DataMap();
    aParamMap.put("someField", "someValue");
    aParamMap.put("foo", "bar");
    aParamMap.put("empty", new DataMap());
    DataList bParamList = new DataList();
    bParamList.add("x");
    bParamList.add("y");
    bParamList.add("z");
    queryParams.put("aParam", aParamMap);
    queryParams.put("bParam", bParamList);

    UriBuilder uriBuilder = new UriBuilder();
    URIParamUtils.addSortedParams(uriBuilder, queryParams);
    String query = uriBuilder.build().getQuery();

    Assert.assertEquals(query, "aParam=(empty:(),foo:bar,someField:someValue)&bParam=List(x,y,z)");
  }