Report { public void remove(final String key) { convertToMap(); map.remove(key); } Report(); private  Report(String s); void put(final String key, final String value, boolean append); void put(final String key, final String value); void remove(final String key); XTraceMetadata getMetadata(); List<String> get(String key); @Override String toString(); static Report createFromString(final String s); @Override boolean equals(Object o);  }
@Test public void testRemove() { Report r = new Report(); r.put("Key1", "Value1"); r.put("Key2", "Value2"); List<String> kset = r.get("Key1"); assertEquals(kset.size(), 1); assertTrue(kset.contains("Value1")); r.remove("Key1"); kset = r.get("Key1"); assertNull(kset); r.remove("Key2"); kset = r.get("Key2"); assertNull(kset); r.put("Key4", "Value4.1"); r.put("Key4", "Value4.2"); r.put("Key4", "Value4.3"); kset = r.get("Key4"); assertNotNull(kset); assertEquals(kset.size(), 3); assertTrue(kset.contains("Value4.1")); assertTrue(kset.contains("Value4.2")); assertTrue(kset.contains("Value4.3")); r.remove("Key4"); kset = r.get("Key4"); assertNull(kset); }