Java tutorial
import java.util.Arrays; import java.util.stream.Stream; public class Main { public static void main(String[] args) { // collect as typed array Stream<String> words = Stream.of("All", "men", "are", "created", "equal"); final String[] wordsArray = words.toArray(String[]::new); Arrays.asList(wordsArray).forEach(n -> System.out.println(n)); } }