mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-03 20:33:31 +07:00
GitOrigin-RevId: 22a46c15d8900d8a31514846755a013f6a67ad42
17 lines
546 B
Java
17 lines
546 B
Java
// "Replace lambda expression with 'Function.identity()'" "true-preview"
|
|
import java.util.Objects;
|
|
import java.util.Optional;
|
|
import java.util.function.UnaryOperator;
|
|
import java.util.regex.Pattern;
|
|
|
|
public class Main {
|
|
private final Pattern pattern = Pattern.compile("[a-z]");
|
|
|
|
public <T extends CharSequence> void test() {
|
|
Object str = "def";
|
|
String xyz = Optional.of("xyz").map(x <caret>-> x).filter(x -> Objects.equals(x, str))
|
|
.filter(str -> pattern.matcher(str).find()).orElse("");
|
|
UnaryOperator<T> op = x -> x;
|
|
}
|
|
}
|