mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-02 22:51:01 +07:00
12 lines
318 B
Java
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;
|
|
}
|
|
} |