Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
package com.technologyconversations.java8exercises.streams;
import java.util.ArrayList;
import java.util.List;
import static;
public class ToUpperCase {
public static List<String> transform7(List<String> collection) {
List<String> coll = new ArrayList<>();
for (String element : collection) {
return coll;
public static List<String> transform(List<String> collection) {
return // Convert collection to Stream
.map(String::toUpperCase) // Convert each element to upper case
.collect(toList()); // Collect results to a new list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment