/** * Returns true if this set is empty. * * @return true if this set is empty. * @throws DataAccessLayerException in case of data access failure. */ public boolean isEmpty() throws DataAccessLayerException { return _map.isEmpty(); }
/** * Returns true if this set is empty. * * @return true if this set is empty. * @throws DataAccessLayerException in case of data access failure. */ public boolean isEmpty() throws DataAccessLayerException { return _map.isEmpty(); }
@Test public void clearTest() throws DataAccessLayerException { map.clear(); assertTrue(map.isEmpty()); }
@Test public void removeTest() throws DataAccessLayerException { assertEquals(TESTDATA1.size(), map.size()); for (String key : TESTDATA4.keySet()) { assertNull(map.remove(key)); } for (String key : TESTDATA1.keySet()) { assertEquals(TESTDATA1.get(key), map.remove(key)); } assertTrue(map.isEmpty()); }
@Test public void insertAllTest() throws DataAccessLayerException { map.clear(); assertTrue(map.isEmpty()); map.putAll(TESTDATA1); for (String key : TESTDATA1.keySet()) { assertTrue(map.containsKey(key)); } for (String key : TESTDATA1.keySet()) { assertEquals(TESTDATA1.get(key), map.get(key)); } }
@Test public void overwriteTest() throws DataAccessLayerException { map.clear(); assertTrue(map.isEmpty()); map.putAll(TESTDATA1); map.putAll(TESTDATA2); assertEquals(map.size(), TESTDATA2.size()); assertTrue(map.entrySet().containsAll(TESTDATA2.entrySet())); }
@Test public void duplicatesTest() throws DataAccessLayerException { map.clear(); assertTrue(map.isEmpty()); map.putAll(TESTDATA1); map.putAll(TESTDATA1); map.putAll(TESTDATA1); assertTrue(map.size() == TESTDATA1.size()); }