@Test public void testNaturalOrder() { DynamicSortedTreeSet<String> queue = new DynamicSortedTreeSet<>(); queue.add("2nd"); queue.add("1st"); queue.add("3rd"); List<String> ordered = new ArrayList<>(queue); assertEquals(Arrays.asList(new String[] { "1st", "2nd", "3rd" }), ordered); }
@Override public boolean add(E e) { return map.put(e, e) == null; }
DynamicSortedTreeSet extends AbstractSet<E> implements List<E>, Deque<E> { @Override public boolean add(E e) { return map.put(e, e) == null; } }
DynamicSortedTreeSet extends AbstractSet<E> implements List<E>, Deque<E> { @Override public boolean add(E e) { return map.put(e, e) == null; } DynamicSortedTreeSet();  DynamicSortedTreeSet(Comparator<E> comparator); }
DynamicSortedTreeSet extends AbstractSet<E> implements List<E>, Deque<E> { @Override public boolean add(E e) { return map.put(e, e) == null; } DynamicSortedTreeSet();  DynamicSortedTreeSet(Comparator<E> comparator); @Override boolean add(E e); @Override void add(int index, E element); @Override boolean addAll(int index, Collection<? extends E> c); @Override void addFirst(E e); @Override void addLast(E e); @Override void clear(); @Override boolean contains(Object o); @Override Iterator<E> descendingIterator(); @Override E element(); @Override E get(int index); @Override E getFirst(); @Override E getLast(); @Override int indexOf(Object o); @Override boolean isEmpty(); @Override Iterator<E> iterator(); @Override int lastIndexOf(Object o); @Override ListIterator<E> listIterator(); @Override ListIterator<E> listIterator(int index); @Override boolean offer(E e); @Override boolean offerFirst(E e); @Override boolean offerLast(E e); @Override E peek(); @Override E peekFirst(); @Override E peekLast(); @Override E poll(); @Override E pollFirst(); @Override E pollLast(); @Override E pop(); @Override void push(E e); @Override E remove(); @Override E remove(int index); @Override boolean remove(Object o); @Override boolean removeAll(Collection<?> c); @Override E removeFirst(); @Override boolean removeFirstOccurrence(Object o); @Override E removeLast(); @Override boolean removeLastOccurrence(Object o); @Override boolean retainAll(Collection<?> c); @Override E set(int index, E element); @Override int size(); @Override Spliterator<E> spliterator(); @Override List<E> subList(int fromIndex, int toIndex); boolean update(E e); }
DynamicSortedTreeSet extends AbstractSet<E> implements List<E>, Deque<E> { @Override public boolean add(E e) { return map.put(e, e) == null; } DynamicSortedTreeSet();  DynamicSortedTreeSet(Comparator<E> comparator); @Override boolean add(E e); @Override void add(int index, E element); @Override boolean addAll(int index, Collection<? extends E> c); @Override void addFirst(E e); @Override void addLast(E e); @Override void clear(); @Override boolean contains(Object o); @Override Iterator<E> descendingIterator(); @Override E element(); @Override E get(int index); @Override E getFirst(); @Override E getLast(); @Override int indexOf(Object o); @Override boolean isEmpty(); @Override Iterator<E> iterator(); @Override int lastIndexOf(Object o); @Override ListIterator<E> listIterator(); @Override ListIterator<E> listIterator(int index); @Override boolean offer(E e); @Override boolean offerFirst(E e); @Override boolean offerLast(E e); @Override E peek(); @Override E peekFirst(); @Override E peekLast(); @Override E poll(); @Override E pollFirst(); @Override E pollLast(); @Override E pop(); @Override void push(E e); @Override E remove(); @Override E remove(int index); @Override boolean remove(Object o); @Override boolean removeAll(Collection<?> c); @Override E removeFirst(); @Override boolean removeFirstOccurrence(Object o); @Override E removeLast(); @Override boolean removeLastOccurrence(Object o); @Override boolean retainAll(Collection<?> c); @Override E set(int index, E element); @Override int size(); @Override Spliterator<E> spliterator(); @Override List<E> subList(int fromIndex, int toIndex); boolean update(E e);  }