@Test public void testSaturatedAdd() { for(int i : TEST_BOUNDS) { BoundedSetFactory<String> bsf = new BoundedSetFactory<String>(i); BoundedSet<String> bs = boundedSet(bsf,0,i-1); String t = getElement(i); bs.add(t); assert(bs.isSaturated() == true); assert(bs.getSize() == i+1); assert(bsf.top().equals(bs)); BoundedSet<String> top = bsf.top(); String t2 = getElement(i+1); top.add(t2); assert(top.equals(bs)); assert(bs.equals(top)); } }
public BoundedSet<V> top() { return top; }
BoundedSetFactory { public BoundedSet<V> top() { return top; } }
BoundedSetFactory { public BoundedSet<V> top() { return top; } BoundedSetFactory(int limit); }
BoundedSetFactory { public BoundedSet<V> top() { return top; } BoundedSetFactory(int limit); BoundedSet<V> empty(); BoundedSet<V> singleton(V el); BoundedSet<V> top(); }
BoundedSetFactory { public BoundedSet<V> top() { return top; } BoundedSetFactory(int limit); BoundedSet<V> empty(); BoundedSet<V> singleton(V el); BoundedSet<V> top();  }