Text key = new Text("" + i);
IntWritable value = new IntWritable(i);
map.put(key, value);
assertEquals(i + 1, map.size());
assertTrue(map.containsKey(new Text("" + i)));
assertTrue(map.containsValue(new IntWritable(i)));
map.remove(key);
assertEquals(i, map.size());
map.put(key, value);
assertEquals(value, map.get(key));
assertFalse(map.isEmpty());