Skip to content

Instantly share code, notes, and snippets.

@priort
Created December 30, 2018 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save priort/621d9885a9dde24089965c3fdc437183 to your computer and use it in GitHub Desktop.
Save priort/621d9885a9dde24089965c3fdc437183 to your computer and use it in GitHub Desktop.
public static void main (String[] args) {
List inputList =
Arrays.asList("functional", "programming", "with", "closures");
List mappedList = inputList.stream().map(s -> s.length()).collect(toList());
System.out.println("Initial List: " + inputList);
System.out.println("Mapped List: " + mappedList);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment