@Test public void try_split_single_entry() { PersistentHashSet<Integer> set = new PersistentHashSet<Integer>().conj(5); assertThat(set.spliterator().trySplit()).isNull(); Spliterator<Integer> spliterator = set.spliterator(); assertThat(spliterator.tryAdvance(i-> assertThat(i).isEqualTo(5) )).isTrue(); assertThat(spliterator.trySplit()).isNull(); }
@Override public Spliterator<E> spliterator() { return new ElementSpliterator<E>(root, size, true); }
PersistentHashSet extends AbstractTrieSet<E, PersistentHashSet<E>> implements PersistentSet<E> { @Override public Spliterator<E> spliterator() { return new ElementSpliterator<E>(root, size, true); } }
PersistentHashSet extends AbstractTrieSet<E, PersistentHashSet<E>> implements PersistentSet<E> { @Override public Spliterator<E> spliterator() { return new ElementSpliterator<E>(root, size, true); } PersistentHashSet(); @SuppressWarnings("unchecked")  PersistentHashSet(Node<E, EntryNode<E>> root, int size); }
PersistentHashSet extends AbstractTrieSet<E, PersistentHashSet<E>> implements PersistentSet<E> { @Override public Spliterator<E> spliterator() { return new ElementSpliterator<E>(root, size, true); } 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 Spliterator<E> spliterator() { return new ElementSpliterator<E>(root, size, true); } 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();  }