// "Replace Stream API chain with loop" "true-preview" import java.util.List; import java.util.OptionalInt; public class Main { interface Index { int asInteger(); } interface IndexSet { List asList(); } public static OptionalInt min(IndexSet set) { return set.asList() .stream() .mapToInt(Index::asInteger) .min(); } }