SimpleContainer implements Containerlike<T> { @Override public int getSizeLimit() { if (sizeLimit < 0) { return -1; } return sizeLimit; } SimpleContainer();  SimpleContainer(ThingTypeCheck<T> verifier);  SimpleContainer(ThingTypeCheck<T> verifier, int limit); @Override boolean canFit(T thing); @Override Collection<T> findSimilar(ThingTypeCheck<T>judge); @Override Collection<T> removeUnfit(); @Override boolean hasUnfit(); @Override void setVerifier(ThingTypeCheck<T> verifier); @Override ThingTypeCheck<T> getVerifier(); @Override boolean hasSizeLimit(); @Override int getSizeLimit(); @Override int setSizeLimit(int limit); @Override boolean add(T o); @Override boolean offer(T o); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Iterator<T> iterator(); @Override T[] toArray(); @Override T[] toArray(T[] a); @Override boolean remove(Object o); @Override boolean containsAll(Collection c); @Override boolean addAll(Collection c); @Override boolean removeAll(Collection c); @Override boolean retainAll(Collection c); @Override void clear(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test @Covers({"public int getSizeLimit()", "public int setSizeLimit(int) throws IllegalStateException", }) public void testGetSizeLimit() { SimpleContainer instance = new SimpleContainer(); int expResult = -1; int result = instance.getSizeLimit(); assertEquals(expResult, result); instance.add(new Object()); instance.setSizeLimit(2); assertEquals(2, instance.getSizeLimit()); instance.add(new Object()); try { instance.add(new Object()); fail("size limit not in effect"); } catch(IllegalStateException e) { } }