mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 11:37:34 +07:00
StreamToLoop: min/max: Comparators as lambdas/method references supported; Comparator.naturalOrder() and reverseOrder() inlined.
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
private static Optional<String> max(Map<String, List<String>> dependencies, String fruits, Map<String, String> weights) {
|
||||
return dependencies.get(fruits).stream().m<caret>ax((o1, o2) -> weights.get(o1).compareTo(weights.get(o2)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user