Created
May 13, 2013 18:24
-
-
Save globulon/5570314 to your computer and use it in GitHub Desktop.
First attempt to curry a side effect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static <T> Consumer<T> traceMessage(final String prefix) { | |
| return t -> System.out.println(String.format("%s: %s", prefix, t)); | |
| } | |
| final Comparator<Person> compareAsc = Person::ageDifference; | |
| people.stream().min(compareAsc).ifPresent(traceMessage("Younger")); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could work with Function<T, R> anyway