IntegerHashSet implements SnapshotableSet<Long>, Trackable { @VisibleForTesting boolean add(Integer value) { return add(value.longValue()); } IntegerHashSet(int initialCapacity, int maxCapacity);  IntegerHashSet(int maxCapacity); private  IntegerHashSet(IntegerHashSet set); @Override boolean contains(Object value); @Override boolean add(Long value); @Override boolean remove(Object value); @Override int size(); @Override boolean isEmpty(); @Override Iterator<Long> iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] result); @Override boolean containsAll(Collection<?> values); @Override boolean addAll(Collection<? extends Long> values); @Override boolean retainAll(Collection<?> values); @Override boolean removeAll(Collection<?> values); @Override void clear(); @Override SnapshotableSet<Long> makeSnapshot(); @Override SnapshotableSet<Long> makeTransientSnapshot(); @Override boolean hasChanged(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test( groups = "fast", expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = ".*23.*") public void testMaxCapacity() throws Exception { int maxCapacity = 23; IntegerHashSet set = new IntegerHashSet(2, maxCapacity); for (int i = 0; i <= maxCapacity; i++) { set.add(i); } }