public static String keyToString(Object key,
                                   URLEscaper.Escaping escaping,
                                   UriComponent.Type componentType,
                                   boolean full,
                                   ProtocolVersion version)
  {
    if (version.compareTo(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion()) >= 0)
    {
      return keyToStringV2(key, escaping, componentType, full);
    }
    else
    {
      return keyToStringV1(key, escaping, full);
    }
  }
@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "complexKey")
  public void testComplexKeyToString(ProtocolVersion version, String full, String notFull)
  {
    MyComplexKey myComplexKey1 = new MyComplexKey();
    myComplexKey1.setA("stringVal");
    myComplexKey1.setB(3);
    MyComplexKey myComplexKey2 = new MyComplexKey();
    myComplexKey2.setA("anotherStringVal");
    myComplexKey2.setB(4);
    ComplexResourceKey<MyComplexKey, MyComplexKey> complexKey =
        new ComplexResourceKey<>(myComplexKey1, myComplexKey2);
    String complexKeyString = URIParamUtils.keyToString(complexKey, NO_ESCAPING, null, true, version);
    Assert.assertEquals(complexKeyString, full);

    // not full
    String complexKeyStringNotFull = URIParamUtils.keyToString(complexKey, NO_ESCAPING, null, false, version);
    Assert.assertEquals(complexKeyStringNotFull, notFull);
  }