代码
提交代码
import java.util.List; import java.util.Arrays; public class Test{ public static void main(String...s){ List<Integer> numbers = Lists.newArrayList(1,2,3,4,5,6,7); long counter = numbers.stream().filter(e->e>5).count(); System.out.println(counter); } }
运行结果