@Override
  public boolean remove(Object o) {
    if (o instanceof Pair) {
      Object first = ((Pair<?, ?>) o).first();
      Object second = ((Pair<?, ?>) o).second();
      if (first instanceof Integer && (second == null || second instanceof StructLike)) {
        return remove((Integer) first, (StructLike) second);
      }
    }

    return false;
  }
@Test
  public void testRemove() {
    PartitionSet set = PartitionSet.create(SPECS);
    set.add(BY_DATA_SPEC.specId(), Row.of("a"));
    set.add(UNPARTITIONED_SPEC.specId(), null);
    set.add(UNPARTITIONED_SPEC.specId(), Row.of());
    set.add(BY_DATA_CATEGORY_BUCKET_SPEC.specId(), CustomRow.of("a", 1));

    assertThat(set).hasSize(4);
    assertThat(set.remove(BY_DATA_SPEC.specId(), CustomRow.of("a"))).isTrue();
    assertThat(set.remove(UNPARTITIONED_SPEC.specId(), null)).isTrue();
    assertThat(set.remove(UNPARTITIONED_SPEC.specId(), CustomRow.of())).isTrue();
    assertThat(set.remove(BY_DATA_CATEGORY_BUCKET_SPEC.specId(), Row.of("a", 1))).isTrue();
    assertThat(set).isEmpty();
  }