// "Replace Stream API chain with loop" "true" import java.util.*; public class Main { private static Optional max(Map> dependencies, String fruits, Map weights) { return dependencies.get(fruits).stream().max((o1, o2) -> weights.get(o1).compareTo(weights.get(o2))); } }