@Override
  public Set<Pair<Integer, StructLike>> keySet() {
    PartitionSet keySet = PartitionSet.create(specs);

    for (Entry<Integer, Map<StructLike, V>> specIdAndPartitionMap : partitionMaps.entrySet()) {
      int specId = specIdAndPartitionMap.getKey();
      Map<StructLike, V> partitionMap = specIdAndPartitionMap.getValue();
      for (StructLike partition : partitionMap.keySet()) {
        keySet.add(specId, partition);
      }
    }

    return Collections.unmodifiableSet(keySet);
  }
@Test
  public void testKeySet() {
    PartitionMap<String> map = PartitionMap.create(SPECS);
    map.put(BY_DATA_SPEC.specId(), Row.of("aaa"), "v1");
    map.put(BY_DATA_SPEC.specId(), CustomRow.of("ccc"), "v2");
    assertThat(map.get(BY_DATA_SPEC.specId(), CustomRow.of("aaa"))).isEqualTo("v1");
    assertThat(map.get(BY_DATA_SPEC.specId(), Row.of("ccc"))).isEqualTo("v2");
  }