mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-24 09:20:53 +07:00
10 lines
292 B
Java
10 lines
292 B
Java
// "Collapse loop with stream 'findFirst()'" "true-preview"
|
|
|
|
import java.util.List;
|
|
|
|
public class Main {
|
|
public void testCast(List<Object> data) {
|
|
String found = (String) data.stream().filter(obj -> obj instanceof String).findFirst().orElse(null);
|
|
System.out.println(found);
|
|
}
|
|
} |