Skip to content

Instantly share code, notes, and snippets.

@eutkin
Created March 5, 2019 12:00
Show Gist options
  • Save eutkin/a18ba2f3a16855578706be83fdf2d5a2 to your computer and use it in GitHub Desktop.
Save eutkin/a18ba2f3a16855578706be83fdf2d5a2 to your computer and use it in GitHub Desktop.
package io.github.eutkin.crud;
import java.util.function.Predicate;
import java.util.stream.Stream;
public class A {
public static void main(String[] args) {
Stream<Predicate<Integer>> predicates = Stream.of(
i -> i % 3 == 0,
i -> i % 5 == 0
);
// i делится на 3 и на 5
Predicate<Integer> predicate = predicates.reduce(i -> true, Predicate::and);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment