ColtHashSet extends AbstractSet<Long> implements SnapshotableSet<Long> { @Override public synchronized boolean add(Long aLong) { version++; return map.put(aLong, TRUE); } ColtHashSet(int initialCapacity, double minLoadFactor, double maxLoadFactor);  ColtHashSet(int initialCapacity); @Override synchronized boolean add(Long aLong); @Override Iterator<Long> iterator(); @Override synchronized int size(); @Override SnapshotableSet<Long> makeSnapshot(); @Override SnapshotableSet<Long> makeTransientSnapshot();  }
@Test(groups = "fast") public void testAdd() throws Exception { Assert.assertEquals(set.size(), 0); Assert.assertTrue(set.add(100L)); Assert.assertTrue(set.contains(100L)); Assert.assertEquals(set.size(), 1); Assert.assertFalse(set.add(100L)); Assert.assertEquals(set.size(), 1); Assert.assertTrue(set.add(200L)); Assert.assertTrue(set.contains(100L)); Assert.assertTrue(set.contains(200L)); Assert.assertEquals(set.size(), 2); }
@Test(groups = "fast") public void testIsEmpty() throws Exception { Assert.assertTrue(set.isEmpty()); Assert.assertTrue(set.add(100L)); Assert.assertFalse(set.isEmpty()); }
@Test(groups = "fast") public void testRemove() throws Exception { Assert.assertTrue(set.add(1L)); Assert.assertTrue(set.remove(1L)); Assert.assertFalse(set.remove(1L)); }