/** * Returns the size of this set. * * @return the size of this set. * @throws DataAccessLayerException in case of data access failure. */ public int size() throws DataAccessLayerException { return _map.size(); }
/** * Returns true if this map is empty. * * @return true if this map is empty. * @throws DataAccessLayerException in case of data access failure. */ public boolean isEmpty() throws DataAccessLayerException { return size() == 0; }
/** * Returns the size of this set. * * @return the size of this set. * @throws DataAccessLayerException in case of data access failure. */ public int size() throws DataAccessLayerException { return _map.size(); }
/** * Returns true if this map is empty. * * @return true if this map is empty. * @throws DataAccessLayerException in case of data access failure. */ public boolean isEmpty() throws DataAccessLayerException { return size() == 0; }
@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 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()); }