private void testMap(Map<Data, Data> data) {
    Assert.assertEquals(0, data.size());
    for (int i = 0; i < 10; i++) {
      data.put(new Data(i), new Data(2 * i));
    }
    Assert.assertEquals(10, data.size());
    for (int i = 0; i < 10; i++) {
      Assert.assertEquals(new Data(2 * i), data.get(new Data(i)));
    }
    for (int i = 0; i < 10; i++) {
      data.put(new Data(i), new Data(3 * i));
    }
    Assert.assertEquals(10, data.size());
    for (int i = 0; i < 10; i++) {
      Assert.assertEquals(new Data(3 * i), data.get(new Data(i)));
    }
  }