Stream<String> stream = Stream.of("Apple", "Banana", "Coconut"); List<String> fruits = stream.toList(); fruits.forEach(System.out::println);