public DataMap toDataMap()
  {
    DataMap dataMap = new DataMap(_keys.size());
    for (Map.Entry<String, ValueAndTypeInfoPair> keyParts : _keys.entrySet())
    {
      String key = keyParts.getKey();
      ValueAndTypeInfoPair valueAndTypeInfoPair = keyParts.getValue();
      Object value = valueAndTypeInfoPair.getValue();
      TypeInfo typeInfo = valueAndTypeInfoPair.getTypeInfo();
      DataSchema schema = typeInfo.getDeclared().getSchema();
      Object coercedInput = coerceValueForDataMap(value, schema);
      dataMap.put(key, coercedInput);
    }
    return dataMap;
  }
@Test
  public void testToDataMap()
  {
    CompoundKey compoundKey = new CompoundKey();
    compoundKey.append("foo", "foo-value");
    compoundKey.append("bar", 1);
    compoundKey.append("baz", 7L);

    DataMap dataMap = compoundKey.toDataMap();
    Assert.assertEquals(dataMap.get("foo"), compoundKey.getPart("foo"));
    Assert.assertEquals(dataMap.get("bar"), compoundKey.getPart("bar"));
    Assert.assertEquals(dataMap.get("baz"), compoundKey.getPart("baz"));
  }