Java tutorial
import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class Main { public static void main(String[] args) throws Exception { // map List<String> words = Arrays.asList("Hello", "World"); List<Integer> wordLengths = words.stream().map(String::length).collect(Collectors.toList()); System.out.println(wordLengths); } }