Your lambda expression returns a value. If you use brackets you need to add a return statement to your lambda function:
List words = Arrays.asList("Oracle", "Java", "Magazine");
List wordLengths = words.stream().map((x) -> {
return x.toUpperCase();
}).collect(Collectors.toList());