@Test public void multiple(){ assertThat(of(1, 2, 3,1,2,3).toSet(),equalTo(new java.util.HashSet<>(Arrays.asList(1,2,3)))); }
public static <T> TrieSet<T> of(T... values){ HashedPatriciaTrie.Node<T, T> tree = HashedPatriciaTrie.empty(); for(T value : values){ tree = tree.put(value.hashCode(),value,value); } return new TrieSet<>(tree); }
TrieSet implements ImmutableSet<T>,
                                         Higher<trieSet,T>,
                                         Serializable { public static <T> TrieSet<T> of(T... values){ HashedPatriciaTrie.Node<T, T> tree = HashedPatriciaTrie.empty(); for(T value : values){ tree = tree.put(value.hashCode(),value,value); } return new TrieSet<>(tree); } }
TrieSet implements ImmutableSet<T>,
                                         Higher<trieSet,T>,
                                         Serializable { public static <T> TrieSet<T> of(T... values){ HashedPatriciaTrie.Node<T, T> tree = HashedPatriciaTrie.empty(); for(T value : values){ tree = tree.put(value.hashCode(),value,value); } return new TrieSet<>(tree); }  }
TrieSet implements ImmutableSet<T>,
                                         Higher<trieSet,T>,
                                         Serializable { public static <T> TrieSet<T> of(T... values){ HashedPatriciaTrie.Node<T, T> tree = HashedPatriciaTrie.empty(); for(T value : values){ tree = tree.put(value.hashCode(),value,value); } return new TrieSet<>(tree); }  static TrieSet<T> empty(); static TrieSet<T> of(T... values); static TrieSet<T> fromStream(Stream<T> stream); static TrieSet<T> fromIterable(Iterable<T> it); boolean containsValue(T value); @Override int size(); @Override TrieSet<T> add(T value); @Override TrieSet<T> removeValue(T value); @Override boolean isEmpty(); @Override TrieSet<R> map(Function<? super T, ? extends R> fn); @Override TrieSet<R> flatMap(Function<? super T, ? extends ImmutableSet<? extends R>> fn); @Override TrieSet<R> concatMap(Function<? super T, ? extends Iterable<? extends R>> fn); @Override TrieSet<R> mergeMap(Function<? super T, ? extends Publisher<? extends R>> fn); @Override TrieSet<R> mergeMap(int maxConcurecy, Function<? super T, ? extends Publisher<? extends R>> fn); @Override TrieSet<T> filter(Predicate<? super T> predicate); @Override ImmutableSet<R> unitStream(Stream<R> stream); TrieSet<T> plus(T value); TrieSet<T> remove(T value); @Override TrieSet<R> unitIterable(Iterable<R> it); @Override ReactiveSeq<T> stream(); @Override Iterator<T> iterator(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); TrieSet<T> take(final long n); TrieSet<T> takeWhile(Predicate<? super T> p); TrieSet<T> dropWhile(Predicate<? super T> p); TrieSet<T> drop(final long num); TrieSet<T> reverse(); Tuple2<TrieSet<T>,TrieSet<T>> duplicate(); Tuple2<TrieSet<R1>, TrieSet<R2>> unzip(Function<? super T, Tuple2<? extends R1, ? extends R2>> fn); @Override TrieSet<T> removeFirst(Predicate<? super T> pred); TrieSet<T> append(T append); TrieSet<T> appendAll(Iterable<? extends T> it); R foldLeft(R zero, BiFunction<R, ? super T, R> f); @Override TrieSet<U> ofType(Class<? extends U> type); @Override TrieSet<T> filterNot(Predicate<? super T> predicate); @Override TrieSet<T> notNull(); @Override TrieSet<T> peek(Consumer<? super T> c); @Override TrieSet<T> removeStream(Stream<? extends T> stream); @Override TrieSet<T> retainAll(Iterable<? extends T> it); @Override TrieSet<T> retainStream(Stream<? extends T> stream); @Override TrieSet<T> retainAll(T... values); @Override TrieSet<ReactiveSeq<T>> permutations(); @Override TrieSet<ReactiveSeq<T>> combinations(int size); @Override TrieSet<ReactiveSeq<T>> combinations(); @Override TrieSet<R> zip(BiFunction<? super T, ? super T2, ? extends R> fn, Publisher<? extends T2> publisher); @Override TrieSet<R> zipWithStream(Stream<? extends U> other, BiFunction<? super T, ? super U, ? extends R> zipper); @Override TrieSet<Tuple2<T, U>> zipWithPublisher(Publisher<? extends U> other); @Override TrieSet<Tuple2<T, U>> zip(Iterable<? extends U> other); @Override TrieSet<R> zip3(Iterable<? extends S> second, Iterable<? extends U> third, Function3<? super T, ? super S, ? super U, ? extends R> fn3); @Override TrieSet<R> zip4(Iterable<? extends T2> second, Iterable<? extends T3> third, Iterable<? extends T4> fourth, Function4<? super T, ? super T2, ? super T3, ? super T4, ? extends R> fn); @Override TrieSet<T> combine(BiPredicate<? super T, ? super T> predicate, BinaryOperator<T> op); @Override TrieSet<T> combine(Monoid<T> op, BiPredicate<? super T, ? super T> predicate); @Override TrieSet<T> cycle(long times); @Override TrieSet<T> cycle(Monoid<T> m, long times); @Override TrieSet<T> cycleWhile(Predicate<? super T> predicate); @Override TrieSet<T> cycleUntil(Predicate<? super T> predicate); @Override TrieSet<R> zip(Iterable<? extends U> other, BiFunction<? super T, ? super U, ? extends R> zipper); @Override TrieSet<Tuple3<T, S, U>> zip3(Iterable<? extends S> second, Iterable<? extends U> third); @Override TrieSet<Tuple4<T, T2, T3, T4>> zip4(Iterable<? extends T2> second, Iterable<? extends T3> third, Iterable<? extends T4> fourth); @Override TrieSet<Tuple2<T, Long>> zipWithIndex(); @Override TrieSet<Seq<T>> sliding(int windowSize); @Override TrieSet<Seq<T>> sliding(int windowSize, int increment); @Override TrieSet<C> grouped(int size, Supplier<C> supplier); @Override TrieSet<Vector<T>> groupedUntil(Predicate<? super T> predicate); @Override TrieSet<Vector<T>> groupedUntil(BiPredicate<Vector<? super T>, ? super T> predicate); @Override TrieSet<Tuple2<T, U>> zipWithStream(Stream<? extends U> other); @Override TrieSet<Vector<T>> groupedWhile(Predicate<? super T> predicate); @Override TrieSet<C> groupedWhile(Predicate<? super T> predicate, Supplier<C> factory); @Override TrieSet<C> groupedUntil(Predicate<? super T> predicate, Supplier<C> factory); @Override TrieSet<Vector<T>> grouped(int groupSize); @Override TrieSet<T> distinct(); @Override TrieSet<T> scanLeft(Monoid<T> monoid); @Override TrieSet<U> scanLeft(U seed, BiFunction<? super U, ? super T, ? extends U> function); @Override TrieSet<T> scanRight(Monoid<T> monoid); @Override TrieSet<U> scanRight(U identity, BiFunction<? super T, ? super U, ? extends U> combiner); @Override TrieSet<T> sorted(); @Override TrieSet<T> sorted(Comparator<? super T> c); @Override TrieSet<T> takeUntil(Predicate<? super T> p); @Override TrieSet<T> dropUntil(Predicate<? super T> p); @Override TrieSet<T> dropRight(int num); @Override TrieSet<T> takeRight(int num); @Override TrieSet<T> intersperse(T value); @Override TrieSet<T> shuffle(); @Override TrieSet<T> shuffle(Random random); @Override TrieSet<T> slice(long from, long to); @Override TrieSet<T> prependStream(Stream<? extends T> stream); @Override TrieSet<T> appendAll(T... values); @Override TrieSet<T> prependAll(T... values); @Override TrieSet<T> deleteBetween(int start, int end); @Override TrieSet<T> insertStreamAt(int pos, Stream<T> stream); @Override TrieSet<T> sorted(Function<? super T, ? extends U> function); String mkString(); @Override TrieSet<T> onEmpty(T value); @Override TrieSet<T> onEmptyGet(Supplier<? extends T> supplier); @Override TrieSet<T> removeAll(Iterable<? extends T> it); @Override TrieSet<T> removeAll(T... values); @Override TrieSet<T> prepend(T value); @Override TrieSet<T> removeAt(long pos); @Override TrieSet<T> prependAll(Iterable<? extends T> value); @Override TrieSet<T> updateAt(int pos, T value); @Override TrieSet<T> insertAt(int pos, Iterable<? extends T> values); @Override TrieSet<R> forEach4(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, ? extends Iterable<R3>> iterable3, Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction); @Override TrieSet<R> forEach4(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, ? extends Iterable<R3>> iterable3, Function4<? super T, ? super R1, ? super R2, ? super R3, Boolean> filterFunction, Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction); @Override TrieSet<R> forEach3(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, ? extends R> yieldingFunction); @Override TrieSet<R> forEach3(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, Boolean> filterFunction, Function3<? super T, ? super R1, ? super R2, ? extends R> yieldingFunction); @Override TrieSet<R> forEach2(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends R> yieldingFunction); @Override TrieSet<R> forEach2(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, Boolean> filterFunction, BiFunction<? super T, ? super R1, ? extends R> yieldingFunction); @Override TrieSet<T> insertAt(int i, T value); @Override TrieSet<T> insertAt(int pos, T... values); }
TrieSet implements ImmutableSet<T>,
                                         Higher<trieSet,T>,
                                         Serializable { public static <T> TrieSet<T> of(T... values){ HashedPatriciaTrie.Node<T, T> tree = HashedPatriciaTrie.empty(); for(T value : values){ tree = tree.put(value.hashCode(),value,value); } return new TrieSet<>(tree); }  static TrieSet<T> empty(); static TrieSet<T> of(T... values); static TrieSet<T> fromStream(Stream<T> stream); static TrieSet<T> fromIterable(Iterable<T> it); boolean containsValue(T value); @Override int size(); @Override TrieSet<T> add(T value); @Override TrieSet<T> removeValue(T value); @Override boolean isEmpty(); @Override TrieSet<R> map(Function<? super T, ? extends R> fn); @Override TrieSet<R> flatMap(Function<? super T, ? extends ImmutableSet<? extends R>> fn); @Override TrieSet<R> concatMap(Function<? super T, ? extends Iterable<? extends R>> fn); @Override TrieSet<R> mergeMap(Function<? super T, ? extends Publisher<? extends R>> fn); @Override TrieSet<R> mergeMap(int maxConcurecy, Function<? super T, ? extends Publisher<? extends R>> fn); @Override TrieSet<T> filter(Predicate<? super T> predicate); @Override ImmutableSet<R> unitStream(Stream<R> stream); TrieSet<T> plus(T value); TrieSet<T> remove(T value); @Override TrieSet<R> unitIterable(Iterable<R> it); @Override ReactiveSeq<T> stream(); @Override Iterator<T> iterator(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); TrieSet<T> take(final long n); TrieSet<T> takeWhile(Predicate<? super T> p); TrieSet<T> dropWhile(Predicate<? super T> p); TrieSet<T> drop(final long num); TrieSet<T> reverse(); Tuple2<TrieSet<T>,TrieSet<T>> duplicate(); Tuple2<TrieSet<R1>, TrieSet<R2>> unzip(Function<? super T, Tuple2<? extends R1, ? extends R2>> fn); @Override TrieSet<T> removeFirst(Predicate<? super T> pred); TrieSet<T> append(T append); TrieSet<T> appendAll(Iterable<? extends T> it); R foldLeft(R zero, BiFunction<R, ? super T, R> f); @Override TrieSet<U> ofType(Class<? extends U> type); @Override TrieSet<T> filterNot(Predicate<? super T> predicate); @Override TrieSet<T> notNull(); @Override TrieSet<T> peek(Consumer<? super T> c); @Override TrieSet<T> removeStream(Stream<? extends T> stream); @Override TrieSet<T> retainAll(Iterable<? extends T> it); @Override TrieSet<T> retainStream(Stream<? extends T> stream); @Override TrieSet<T> retainAll(T... values); @Override TrieSet<ReactiveSeq<T>> permutations(); @Override TrieSet<ReactiveSeq<T>> combinations(int size); @Override TrieSet<ReactiveSeq<T>> combinations(); @Override TrieSet<R> zip(BiFunction<? super T, ? super T2, ? extends R> fn, Publisher<? extends T2> publisher); @Override TrieSet<R> zipWithStream(Stream<? extends U> other, BiFunction<? super T, ? super U, ? extends R> zipper); @Override TrieSet<Tuple2<T, U>> zipWithPublisher(Publisher<? extends U> other); @Override TrieSet<Tuple2<T, U>> zip(Iterable<? extends U> other); @Override TrieSet<R> zip3(Iterable<? extends S> second, Iterable<? extends U> third, Function3<? super T, ? super S, ? super U, ? extends R> fn3); @Override TrieSet<R> zip4(Iterable<? extends T2> second, Iterable<? extends T3> third, Iterable<? extends T4> fourth, Function4<? super T, ? super T2, ? super T3, ? super T4, ? extends R> fn); @Override TrieSet<T> combine(BiPredicate<? super T, ? super T> predicate, BinaryOperator<T> op); @Override TrieSet<T> combine(Monoid<T> op, BiPredicate<? super T, ? super T> predicate); @Override TrieSet<T> cycle(long times); @Override TrieSet<T> cycle(Monoid<T> m, long times); @Override TrieSet<T> cycleWhile(Predicate<? super T> predicate); @Override TrieSet<T> cycleUntil(Predicate<? super T> predicate); @Override TrieSet<R> zip(Iterable<? extends U> other, BiFunction<? super T, ? super U, ? extends R> zipper); @Override TrieSet<Tuple3<T, S, U>> zip3(Iterable<? extends S> second, Iterable<? extends U> third); @Override TrieSet<Tuple4<T, T2, T3, T4>> zip4(Iterable<? extends T2> second, Iterable<? extends T3> third, Iterable<? extends T4> fourth); @Override TrieSet<Tuple2<T, Long>> zipWithIndex(); @Override TrieSet<Seq<T>> sliding(int windowSize); @Override TrieSet<Seq<T>> sliding(int windowSize, int increment); @Override TrieSet<C> grouped(int size, Supplier<C> supplier); @Override TrieSet<Vector<T>> groupedUntil(Predicate<? super T> predicate); @Override TrieSet<Vector<T>> groupedUntil(BiPredicate<Vector<? super T>, ? super T> predicate); @Override TrieSet<Tuple2<T, U>> zipWithStream(Stream<? extends U> other); @Override TrieSet<Vector<T>> groupedWhile(Predicate<? super T> predicate); @Override TrieSet<C> groupedWhile(Predicate<? super T> predicate, Supplier<C> factory); @Override TrieSet<C> groupedUntil(Predicate<? super T> predicate, Supplier<C> factory); @Override TrieSet<Vector<T>> grouped(int groupSize); @Override TrieSet<T> distinct(); @Override TrieSet<T> scanLeft(Monoid<T> monoid); @Override TrieSet<U> scanLeft(U seed, BiFunction<? super U, ? super T, ? extends U> function); @Override TrieSet<T> scanRight(Monoid<T> monoid); @Override TrieSet<U> scanRight(U identity, BiFunction<? super T, ? super U, ? extends U> combiner); @Override TrieSet<T> sorted(); @Override TrieSet<T> sorted(Comparator<? super T> c); @Override TrieSet<T> takeUntil(Predicate<? super T> p); @Override TrieSet<T> dropUntil(Predicate<? super T> p); @Override TrieSet<T> dropRight(int num); @Override TrieSet<T> takeRight(int num); @Override TrieSet<T> intersperse(T value); @Override TrieSet<T> shuffle(); @Override TrieSet<T> shuffle(Random random); @Override TrieSet<T> slice(long from, long to); @Override TrieSet<T> prependStream(Stream<? extends T> stream); @Override TrieSet<T> appendAll(T... values); @Override TrieSet<T> prependAll(T... values); @Override TrieSet<T> deleteBetween(int start, int end); @Override TrieSet<T> insertStreamAt(int pos, Stream<T> stream); @Override TrieSet<T> sorted(Function<? super T, ? extends U> function); String mkString(); @Override TrieSet<T> onEmpty(T value); @Override TrieSet<T> onEmptyGet(Supplier<? extends T> supplier); @Override TrieSet<T> removeAll(Iterable<? extends T> it); @Override TrieSet<T> removeAll(T... values); @Override TrieSet<T> prepend(T value); @Override TrieSet<T> removeAt(long pos); @Override TrieSet<T> prependAll(Iterable<? extends T> value); @Override TrieSet<T> updateAt(int pos, T value); @Override TrieSet<T> insertAt(int pos, Iterable<? extends T> values); @Override TrieSet<R> forEach4(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, ? extends Iterable<R3>> iterable3, Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction); @Override TrieSet<R> forEach4(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, ? extends Iterable<R3>> iterable3, Function4<? super T, ? super R1, ? super R2, ? super R3, Boolean> filterFunction, Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction); @Override TrieSet<R> forEach3(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, ? extends R> yieldingFunction); @Override TrieSet<R> forEach3(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, Boolean> filterFunction, Function3<? super T, ? super R1, ? super R2, ? extends R> yieldingFunction); @Override TrieSet<R> forEach2(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends R> yieldingFunction); @Override TrieSet<R> forEach2(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, Boolean> filterFunction, BiFunction<? super T, ? super R1, ? extends R> yieldingFunction); @Override TrieSet<T> insertAt(int i, T value); @Override TrieSet<T> insertAt(int pos, T... values);  }