@Test public void toBagX() throws Exception { assertThat(Reducers.toPersistentBag().foldMap(Stream.of(1,2,3)),equalTo(Bag.of(1,2,3))); assertThat(Bag.empty().plus(10),equalTo(Bag.of(10))); assertThat(Bag.empty().plusAll(Arrays.asList(10)),equalTo(Bag.of(10))); assertThat(Bag.empty().plus(5).plusAll(Arrays.asList(10,20)),equalTo(Bag.of(5,10,20))); }
public static <T> Reducer<PersistentBag<T>,T> toPersistentBag() { return Reducer.fromMonoid(Monoids.concatPersistentCollection(Bag.empty()), a -> Bag.of(a)); }
Reducers { public static <T> Reducer<PersistentBag<T>,T> toPersistentBag() { return Reducer.fromMonoid(Monoids.concatPersistentCollection(Bag.empty()), a -> Bag.of(a)); } }
Reducers { public static <T> Reducer<PersistentBag<T>,T> toPersistentBag() { return Reducer.fromMonoid(Monoids.concatPersistentCollection(Bag.empty()), a -> Bag.of(a)); }  }
Reducers { public static <T> Reducer<PersistentBag<T>,T> toPersistentBag() { return Reducer.fromMonoid(Monoids.concatPersistentCollection(Bag.empty()), a -> Bag.of(a)); }  static Reducer<BankersQueue<T>,T> toBankersQueue(); static Reducer<Seq<T>,T> toSeq(); static Reducer<LazySeq<T>,T> toLazySeq(); static Reducer<IntMap<T>,T> toIntMap(); static Reducer<Vector<T>,T> toVector(); static Reducer<TreeSet<T>,T> toTreeSet(Comparator<T> c); static Reducer<Bag<T>,T> toBag(); static Reducer<TreeSet<T>,T> toTreeSet(); static Reducer<HashSet<T>,T> toHashSet(); static Reducer<TrieSet<T>,T> toTrieSet(); static Reducer<PersistentQueue<T>,T> toPersistentQueue(); static Reducer<PersistentSortedSet<T>,T> toPersistentSortedSet(); static Reducer<PersistentSortedSet<T>,T> toPersistentSortedSet(Comparator<T> comp); static Reducer<PersistentBag<T>,T> toPersistentBag(); static Reducer<PersistentSet<T>,T> toPersistentSet(); static Reducer<PersistentList<T>,T> toPersistentVector(); static Reducer<PersistentList<T>,T> toPersistentList(); static Reducer<PersistentList<T>,T> toPersistentListReversed(); static Reducer<PersistentMap<K, V>,Tuple2<K,V>> toPersistentMap(); static Monoid<String> toString(final String joiner); static Monoid<Integer> toTotalInt(); static Reducer<Integer,T> toCountInt(); static Monoid<Double> toTotalDouble(); static Reducer<Double,T> toCountDouble(); }
Reducers { public static <T> Reducer<PersistentBag<T>,T> toPersistentBag() { return Reducer.fromMonoid(Monoids.concatPersistentCollection(Bag.empty()), a -> Bag.of(a)); }  static Reducer<BankersQueue<T>,T> toBankersQueue(); static Reducer<Seq<T>,T> toSeq(); static Reducer<LazySeq<T>,T> toLazySeq(); static Reducer<IntMap<T>,T> toIntMap(); static Reducer<Vector<T>,T> toVector(); static Reducer<TreeSet<T>,T> toTreeSet(Comparator<T> c); static Reducer<Bag<T>,T> toBag(); static Reducer<TreeSet<T>,T> toTreeSet(); static Reducer<HashSet<T>,T> toHashSet(); static Reducer<TrieSet<T>,T> toTrieSet(); static Reducer<PersistentQueue<T>,T> toPersistentQueue(); static Reducer<PersistentSortedSet<T>,T> toPersistentSortedSet(); static Reducer<PersistentSortedSet<T>,T> toPersistentSortedSet(Comparator<T> comp); static Reducer<PersistentBag<T>,T> toPersistentBag(); static Reducer<PersistentSet<T>,T> toPersistentSet(); static Reducer<PersistentList<T>,T> toPersistentVector(); static Reducer<PersistentList<T>,T> toPersistentList(); static Reducer<PersistentList<T>,T> toPersistentListReversed(); static Reducer<PersistentMap<K, V>,Tuple2<K,V>> toPersistentMap(); static Monoid<String> toString(final String joiner); static Monoid<Integer> toTotalInt(); static Reducer<Integer,T> toCountInt(); static Monoid<Double> toTotalDouble(); static Reducer<Double,T> toCountDouble();  }