Skip to content

Instantly share code, notes, and snippets.

@clarenced
Last active August 29, 2015 14:24
Show Gist options
  • Save clarenced/ed59cd5fffb087cede0f to your computer and use it in GitHub Desktop.
Save clarenced/ed59cd5fffb087cede0f to your computer and use it in GitHub Desktop.
public class Etl {
public Map<String, Integer> transform(Map<Integer, List<String>> old){
Map<Stream<String>, Integer> collect = old.entrySet() //Map.Entry<Integer, List<String>>
.stream() //Stream<Map.Entry<Integer, List<String>>>
.collect(Collectors
.toMap((Map.Entry<Integer, List<String>> entry) -> entry.getValue() //List<String>
.stream() //Stream<List<String>>
.map(Function.<String>identity()),
(Map.Entry<Integer, List<String>> entry2) -> entry2.getKey()));
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment