### Question:
DisjointSet extends AbstractSet<E> implements Serializable { public DisjointSet() { this(false); } DisjointSet();  DisjointSet(final boolean hasTrash);  DisjointSet(final DisjointSet<E> disjointSet); private  DisjointSet(final Map<E, DisjointSet<E>> map); Set<E> getTrash(); @Override int size(); @Override boolean contains(final Object element); @Override boolean add(final E element); @Override boolean remove(final Object element); @Override boolean containsAll(final Collection<?> c); @Override boolean addAll(final Collection<? extends E> c); @Override boolean removeAll(final Collection<?> c); @Override boolean retainAll(final Collection<?> c); @Override void clear(); @Override Iterator<E> iterator(); @Override Object[] toArray(); @Override T[] toArray(final T[] a); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object set);  }### Answer:
@Test public void testDisjointSet() { DisjointSet<String> t1 = new DisjointSet<>(true); DisjointSet<String> t2 = new DisjointSet<>(t1); DisjointSet<String> t3 = new DisjointSet<>(t2); assertNotNull(t1.getTrash()); assertSame(t1.getTrash(), t2.getTrash()); assertSame(t2.getTrash(), t3.getTrash()); assertTrue(t1.add("alpha")); assertTrue(t2.add("bêta")); assertTrue(t3.add("gamma")); assertTrue(t2.add("delta")); assertTrue(t1.add("epsilon")); assertTrue(t2.add("alpha")); assertTrue(t2.remove("bêta")); assertEquals(Collections.singleton("epsilon"), t1); assertEquals(new HashSet<>(Arrays.asList(new String[] {"alpha","delta"})), t2); assertEquals(Collections.singleton("gamma"), t3); assertEquals(Collections.singleton("bêta"), t1.getTrash()); assertNotSame(t1, assertSerializedEquals(t1)); assertNotSame(t2, assertSerializedEquals(t2)); assertNotSame(t3, assertSerializedEquals(t3)); }