Stream<String> stream = Stream.of("a","b", "c");
//转为数组
String[] strArray1 = stream.toArray(String[]::new);
// 转为 Collection 的实现类
List<String> list1 = stream.collect(Collectors.toList());
List<String> list2 = stream.collect(Collectors.toCollection(ArrayList::new));
Set set1 = stream.collect(Collectors.toSet());
Stack stack1 = stream.collect(Collectors.toCollection(Stack::new));
// 转为String
String str = stream.collect(Collectors.joining()).toString();