mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-11 20:07:01 +07:00
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);
|
|
}
|
|
} |