@Test public void testEvery() { assertTrue(Stream.of(1, 1, 1).every(new Func1<Integer, Boolean>() { @Override public Boolean call(Integer it) { return it == 1; } })); assertFalse(Stream.of(1, 2, 1).every(new Func1<Integer, Boolean>() { @Override public Boolean call(Integer it) { return it == 1; } })); assertTrue(Stream.of().every(null)); }
public boolean every(Func1<? super T, Boolean> predicate) { for (T item : this) { if (!predicate.call(item)) return false; } return true; }
Stream implements Iterable<T> { public boolean every(Func1<? super T, Boolean> predicate) { for (T item : this) { if (!predicate.call(item)) return false; } return true; } }
Stream implements Iterable<T> { public boolean every(Func1<? super T, Boolean> predicate) { for (T item : this) { if (!predicate.call(item)) return false; } return true; }  }
Stream implements Iterable<T> { public boolean every(Func1<? super T, Boolean> predicate) { for (T item : this) { if (!predicate.call(item)) return false; } return true; }  static Stream<T> stream(final T[] array); static Stream<T> stream(final Iterable<T> source); static Stream<T> of(final T value); static Stream<T> of(T... values); static Stream<T> of(); R collect(Func1<Iterable<T>, R> collector); R reduce(R initial, Func2<R, T, R> accumulator); Optional<T> reduce(Func2<T, T, T> accumulator); Optional<T> first(); Optional<T> last(); Stream<R> compose(Func1<Stream<T>, Stream<R>> factory); Stream<R> map(final Func1<? super T, ? extends R> func); Stream<R> flatMap(final Func1<? super T, ? extends Iterable<? extends R>> func); Stream<T> filter(final Func1<? super T, Boolean> func); Stream<T> merge(final T value); Stream<T> separate(final T value); Stream<T> merge(final Iterable<? extends T> with); Stream<R> zipWith(final Iterable<? extends S> with, final Func2<? super T, ? super S, ? extends R> func); Stream<T> separate(Iterable<T> from); Stream<T> take(final int count); Stream<T> skip(final int count); Stream<T> distinct(); Stream<T> sort(final Comparator<T> comparator); Stream<T> reverse(); Stream<R> cast(final Class<R> c); boolean every(Func1<? super T, Boolean> predicate); boolean any(Func1<? super T, Boolean> predicate); Stream<Grouped<K, V>> groupBy(final Func1<? super T, ? extends K> groupSelector, final Func1<? super T, ? extends V> valueSelector); Stream<Grouped<K, T>> groupBy(final Func1<? super T, ? extends K> groupSelector); Stream<Indexed<T>> index(); void forEach(Action1<? super T> action); Stream<T> onNext(final Action1<? super T> action); }
Stream implements Iterable<T> { public boolean every(Func1<? super T, Boolean> predicate) { for (T item : this) { if (!predicate.call(item)) return false; } return true; }  static Stream<T> stream(final T[] array); static Stream<T> stream(final Iterable<T> source); static Stream<T> of(final T value); static Stream<T> of(T... values); static Stream<T> of(); R collect(Func1<Iterable<T>, R> collector); R reduce(R initial, Func2<R, T, R> accumulator); Optional<T> reduce(Func2<T, T, T> accumulator); Optional<T> first(); Optional<T> last(); Stream<R> compose(Func1<Stream<T>, Stream<R>> factory); Stream<R> map(final Func1<? super T, ? extends R> func); Stream<R> flatMap(final Func1<? super T, ? extends Iterable<? extends R>> func); Stream<T> filter(final Func1<? super T, Boolean> func); Stream<T> merge(final T value); Stream<T> separate(final T value); Stream<T> merge(final Iterable<? extends T> with); Stream<R> zipWith(final Iterable<? extends S> with, final Func2<? super T, ? super S, ? extends R> func); Stream<T> separate(Iterable<T> from); Stream<T> take(final int count); Stream<T> skip(final int count); Stream<T> distinct(); Stream<T> sort(final Comparator<T> comparator); Stream<T> reverse(); Stream<R> cast(final Class<R> c); boolean every(Func1<? super T, Boolean> predicate); boolean any(Func1<? super T, Boolean> predicate); Stream<Grouped<K, V>> groupBy(final Func1<? super T, ? extends K> groupSelector, final Func1<? super T, ? extends V> valueSelector); Stream<Grouped<K, T>> groupBy(final Func1<? super T, ? extends K> groupSelector); Stream<Indexed<T>> index(); void forEach(Action1<? super T> action); Stream<T> onNext(final Action1<? super T> action);  }