/*
 * Stream是数据渠道,用于操作数据源(集合,数组等)所生成的元素序列。
 * Stream不会改变源数据,每次处理都会返回一个持有结果的新stream
 *  类似于SQL语句对数据库的查询
 * Stream是个延迟操作
 * 
 * 操作步骤
 * 	1.建立一个Stream数据渠道,即指定数据源
 *  2.中间操作可以是0~n步
 *  	
 *  3.取结果
 */
public class TestStream {
	@Test
	public void t2(){
		ArrayList<String> arrayList = new ArrayList<>();
		arrayList.add("1");
		arrayList.add("2");
		arrayList.add("3");
		//Stream<String> stream = arrayList.stream();
		Stream<ArrayList<String>> stream = Stream.of(arrayList);
		stream.forEach(t -> System.out.println(t));
		
	}
}