mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-07 09:46:39 +07:00
GitOrigin-RevId: c4db6507c258e5611f6d47b9373a0c2531802345
9 lines
255 B
Java
9 lines
255 B
Java
// "Collapse loop with stream 'findFirst()'" "true-preview"
|
|
|
|
import java.util.List;
|
|
|
|
public class Main {
|
|
public String testCast(List<Object> data) {
|
|
return (String) data.stream().filter(obj -> obj instanceof String).findFirst().orElse(null);
|
|
}
|
|
} |