@Test public void put_get() throws Exception { final StringKeyObjectMap<Integer> map = new StringKeyObjectMap<Integer>(); Assert.assertNull(map.get("abc")); map.put("abc", Integer.valueOf(0)); Assert.assertEquals(Integer.valueOf(0), map.get("abc")); }
@Test public void clear_isEmpty() throws Exception { final StringKeyObjectMap<Integer> map = new StringKeyObjectMap<Integer>(); Assert.assertTrue(map.isEmpty()); map.put("abc", Integer.valueOf(0)); Assert.assertFalse(map.isEmpty()); Assert.assertEquals(Integer.valueOf(0), map.get("abc")); map.clear(); Assert.assertTrue(map.isEmpty()); Assert.assertNull(map.get("abc")); }