Here you can find the source of toList(final Stream
public final static <T> List<T> toList(final Stream<T> stream)
//package com.java2s; //License from project: Apache License import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; public class Main { /**//from ww w. j ava 2 s . c o m * @return this monad converted to a list */ public final static <T> List<T> toList(final Stream<T> stream) { return stream.collect(Collectors.toList()); } }