@Test public void to_string() { PersistentHashSet<Integer> set = new PersistentHashSet<Integer>(); assertThat(set.toString()).isEqualTo("[]"); set = set.conj(1); assertThat(set.toString()).isEqualTo("[1]"); set = set.conj(2); assertThat(set.toString()).isEqualTo("[1, 2]"); }
@Override public String toString() { return stream().map(Objects::toString).collect(Collectors.joining(", ", "[", "]")); }
PersistentHashSet extends AbstractTrieSet<E, PersistentHashSet<E>> implements PersistentSet<E> { @Override public String toString() { return stream().map(Objects::toString).collect(Collectors.joining(", ", "[", "]")); } }
PersistentHashSet extends AbstractTrieSet<E, PersistentHashSet<E>> implements PersistentSet<E> { @Override public String toString() { return stream().map(Objects::toString).collect(Collectors.joining(", ", "[", "]")); } PersistentHashSet(); @SuppressWarnings("unchecked")  PersistentHashSet(Node<E, EntryNode<E>> root, int size); }
PersistentHashSet extends AbstractTrieSet<E, PersistentHashSet<E>> implements PersistentSet<E> { @Override public String toString() { return stream().map(Objects::toString).collect(Collectors.joining(", ", "[", "]")); } 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 String toString() { return stream().map(Objects::toString).collect(Collectors.joining(", ", "[", "]")); } 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();  }