### Question:
LinkedTreeSet extends AbstractSet<E> { @Override public boolean add(E e) { if (elements.add(e)) { orderedElements.add(e); return true; } return false; } LinkedTreeSet();  LinkedTreeSet(Collection<? extends E> other); @Override boolean add(E e); @Override boolean remove(Object o); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c); @Override void clear(); @Override boolean contains(Object o); @Override Iterator<E> iterator(); @Override int hashCode(); @Override boolean equals(Object o); @Override int size(); @Override String toString();  }### Answer:
@Test void testEqualsAndHashCode() throws Exception { Set<Object> set1 = new LinkedTreeSet<>(); Set<Object> set2 = new LinkedTreeSet<>(); assertThat(set1).hasSameHashCodeAs(set2); assertThat(set1).isEqualTo(set2); set1.add("abc"); assertThat(set1).isNotEqualTo(set2); set2.add("abc"); assertThat(set1).hasSameHashCodeAs(set2); assertThat(set1).isEqualTo(set2); set1.add(1); set1.add(2); set2.add(2); set2.add(1); assertThat(set1).isNotEqualTo(set2); }
@Test void testContainsAll() throws Exception { Set<Object> set1 = new LinkedTreeSet<>(); Set<Object> set2 = new LinkedTreeSet<>(); assertThat(set1.containsAll(set2)).isTrue(); set2.add(1); set2.add(2); assertThat(set1.containsAll(set2)).isFalse(); set1.add(1.0); set1.add(2); set1.add(3.0); assertThat(set1.containsAll(set2)).isTrue(); }