目录 前言 一、示例 二、原理 总结 前言 在jdk9中,Stream中提供了takeWhile的功能。 一、示例 @Test public void testTakeWhile(){ List<Integer> list = List.of(1, 2,