Files
2022-12-23 13:26:29 +00:00

12 lines
318 B
Java

// "Collapse loop with stream 'max()'" "true-preview"
import java.util.Collection;
class Scratch {
native int scale();
private static Integer getMaxScale(Collection<Scratch> updated) {
int maxScale = updated.stream().mapToInt(Scratch::scale).filter(b -> b >= 0).max().orElse(0);
return maxScale;
}
}