SimpleContainer implements Containerlike<T> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final SimpleContainer<T> other = (SimpleContainer<T>) obj; if (!Objects.equals(this.verifier, other.verifier)) { return false; } if (this.sizeLimit != other.sizeLimit) { return false; } if (!Objects.equals(this.storage, other.storage)) { return false; } return true; } 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 boolean equals(Object)") public void testEquals() { SimpleContainer<Integer> first = new SimpleContainer<>(); assertNull(first.getVerifier()); assertEquals(-1, first.getSizeLimit()); assertTrue(first.isEmpty()); SimpleContainer<Integer> second = new SimpleContainer<>(null, -2); assertNull(second.getVerifier()); assertEquals(-1, second.getSizeLimit()); assertTrue(second.isEmpty()); assertNotSame(first, second); assertEquals(first, second); assertFalse(first.equals(new Object())); }