Java Stream of streamToList(Stream stream)

Here you can find the source of streamToList(Stream stream)

Description

stream To List

License

Open Source License

Declaration

public static <T> ArrayList<T> streamToList(Stream<T> stream) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Main {
    public static <T> ArrayList<T> streamToList(Stream<T> stream) {
        return (ArrayList<T>) stream.collect(Collectors.toList());
    }/*  w w w  .ja  va  2 s.  co m*/
}

Related

  1. streamOf(T value)
  2. streamOfEnumeration(Enumeration e, boolean parallel)
  3. streamOfOptional(Optional element)
  4. streamOrEmpty(Iterable iterable)
  5. streamScanner(Scanner scanner)
  6. toParallelStream(Iterator iter)
  7. toStream(Collection collection)
  8. toStream(Enumeration e)
  9. toStream(final Iterable iterable)