문서의 이전 판입니다!
StreamSupport.stream(iterable.spliterator(), false) .filter(...) .moreStreamOps(...);
List<List<Object>> list = ... List<Object> flat = list.stream() .flatMap(List::stream) .collect(Collectors.toList());
public static <T> Stream<T> asStream(@Nullable Collection<T> collection) { return Optional.ofNullable(collection).map(Collection::stream).orElse(Stream.empty()); } public static <T> Stream<T> asStream(@Nullable T[] array) { return Optional.ofNullable(array).map(Arrays::stream).orElse(Stream.empty()); }