@Test public void removeFirst(){ IterableX<Integer> vec = this.of(1,2,2,2,3); assertThat(vec.removeFirst(i->i==2),equalTo(of(1,2,2,3))); }
public static <T> Bag<T> of(T... values){ Bag<T> res = empty(); for(T next : values){ res = res.plus(next); } return res; }
Bag implements ImmutableSet<T>,
                                PersistentBag<T>,
                                Higher<bag,T>,
                                Serializable { public static <T> Bag<T> of(T... values){ Bag<T> res = empty(); for(T next : values){ res = res.plus(next); } return res; } }
Bag implements ImmutableSet<T>,
                                PersistentBag<T>,
                                Higher<bag,T>,
                                Serializable { public static <T> Bag<T> of(T... values){ Bag<T> res = empty(); for(T next : values){ res = res.plus(next); } return res; }  }
Bag implements ImmutableSet<T>,
                                PersistentBag<T>,
                                Higher<bag,T>,
                                Serializable { public static <T> Bag<T> of(T... values){ Bag<T> res = empty(); for(T next : values){ res = res.plus(next); } return res; }  static Bag<T> empty(); static Bag<T> singleton(T value); static Bag<T> of(T... values); static Bag<T> fromStream(Stream<T> values); static Bag<T> fromIterable(Iterable<? extends T> values); int instances(T type); int size(); @Override Bag<T> add(T value); @Override boolean isEmpty(); @Override Bag<R> map(Function<? super T, ? extends R> fn); @Override Bag<R> flatMap(Function<? super T, ? extends ImmutableSet<? extends R>> fn); @Override Bag<R> concatMap(Function<? super T, ? extends Iterable<? extends R>> fn); @Override Bag<R> mergeMap(Function<? super T, ? extends Publisher<? extends R>> fn); @Override Bag<R> mergeMap(int maxConcurecy, Function<? super T, ? extends Publisher<? extends R>> fn); @Override Bag<U> unitIterable(Iterable<U> it); @Override Bag<T> filter(Predicate<? super T> predicate); @Override Bag<R> unitStream(Stream<R> stream); @Override boolean containsValue(final T e); Bag<T> plus(final T value); @Override Bag<T> plusAll(Iterable<? extends T> list); @Override Bag<T> removeAll(Iterable<? extends T> list); @Override Bag<T> removeValue(final T value); ReactiveSeq<T> stream(); @Override Iterator<T> iterator(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Bag implements ImmutableSet<T>,
                                PersistentBag<T>,
                                Higher<bag,T>,
                                Serializable { public static <T> Bag<T> of(T... values){ Bag<T> res = empty(); for(T next : values){ res = res.plus(next); } return res; }  static Bag<T> empty(); static Bag<T> singleton(T value); static Bag<T> of(T... values); static Bag<T> fromStream(Stream<T> values); static Bag<T> fromIterable(Iterable<? extends T> values); int instances(T type); int size(); @Override Bag<T> add(T value); @Override boolean isEmpty(); @Override Bag<R> map(Function<? super T, ? extends R> fn); @Override Bag<R> flatMap(Function<? super T, ? extends ImmutableSet<? extends R>> fn); @Override Bag<R> concatMap(Function<? super T, ? extends Iterable<? extends R>> fn); @Override Bag<R> mergeMap(Function<? super T, ? extends Publisher<? extends R>> fn); @Override Bag<R> mergeMap(int maxConcurecy, Function<? super T, ? extends Publisher<? extends R>> fn); @Override Bag<U> unitIterable(Iterable<U> it); @Override Bag<T> filter(Predicate<? super T> predicate); @Override Bag<R> unitStream(Stream<R> stream); @Override boolean containsValue(final T e); Bag<T> plus(final T value); @Override Bag<T> plusAll(Iterable<? extends T> list); @Override Bag<T> removeAll(Iterable<? extends T> list); @Override Bag<T> removeValue(final T value); ReactiveSeq<T> stream(); @Override Iterator<T> iterator(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }