@Override
  public T remove(Object key) {
    if (key instanceof StructLike || key == null) {
      StructLikeWrapper wrapper = wrappers.get();
      T value = wrapperMap.remove(wrapper.set((StructLike) key));
      wrapper.set(null); // don't hold a reference to the key.
      return value;
    }
    return null;
  }
@Test
  public void testRemove() {
    Record gRecord = GenericRecord.create(STRUCT_TYPE);
    Record record = gRecord.copy(ImmutableMap.of("id", 1, "data", "aaa"));

    Map<StructLike, String> map = StructLikeMap.create(STRUCT_TYPE);
    map.put(record, "1-aaa");
    assertThat(map).hasSize(1).containsEntry(record, "1-aaa");
    assertThat(map.remove(record)).isEqualTo("1-aaa");
    assertThat(map).isEmpty();

    map.put(record, "1-aaa");
    assertThat(map).containsEntry(record, "1-aaa");
  }