@Test public void Add_Incremental() { PersistentHashSet<Integer> set = new PersistentHashSet<>(); Set<Integer> ints = integers(); for (Integer integer : ints) { set = set.conj(integer); } assertThat(set.asSet()).isEqualTo(ints); }
@Override public ImmutableSet<E> asSet() { return new ImmutableSet<E>(this); }
PersistentHashSet extends AbstractTrieSet<E, PersistentHashSet<E>> implements PersistentSet<E> { @Override public ImmutableSet<E> asSet() { return new ImmutableSet<E>(this); } }
PersistentHashSet extends AbstractTrieSet<E, PersistentHashSet<E>> implements PersistentSet<E> { @Override public ImmutableSet<E> asSet() { return new ImmutableSet<E>(this); } PersistentHashSet(); @SuppressWarnings("unchecked")  PersistentHashSet(Node<E, EntryNode<E>> root, int size); }
PersistentHashSet extends AbstractTrieSet<E, PersistentHashSet<E>> implements PersistentSet<E> { @Override public ImmutableSet<E> asSet() { return new ImmutableSet<E>(this); } PersistentHashSet(); @SuppressWarnings("unchecked")  PersistentHashSet(Node<E, EntryNode<E>> root, int size); @Override MutableHashSet<E> toMutableSet(); @Override ImmutableSet<E> asSet(); @Override int size(); @Override Spliterator<E> spliterator(); @Override String toString(); }
PersistentHashSet extends AbstractTrieSet<E, PersistentHashSet<E>> implements PersistentSet<E> { @Override public ImmutableSet<E> asSet() { return new ImmutableSet<E>(this); } PersistentHashSet(); @SuppressWarnings("unchecked")  PersistentHashSet(Node<E, EntryNode<E>> root, int size); @Override MutableHashSet<E> toMutableSet(); @Override ImmutableSet<E> asSet(); @Override int size(); @Override Spliterator<E> spliterator(); @Override String toString();  }