Анимация, иллюстрирующая обработку Java Stream API: AtomicLong cnt = new AtomicLong();
source .stream()
.map(x -> x.squash())
.peek(x -> cnt.incrementAndGet())
.filter(x -> x.getColor() != YELLOW)
.forEach(System.out::println);
Post #148
883