mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
18 lines
449 B
Java
18 lines
449 B
Java
import java.util.List;
|
|
import java.util.function.Function;
|
|
|
|
public class MethodReferences {
|
|
public void foo(List<String> list) {
|
|
list.stream().map(String::toUpperCase);
|
|
list.stream().map(String::chars);
|
|
list.stream().map(java.util.Objects::hashCode); // static method
|
|
|
|
list.stream().map(this::bar);
|
|
Function<String, String> f = null;
|
|
list.stream().map(f::apply);
|
|
}
|
|
|
|
private String bar(String s) {
|
|
return null;
|
|
}
|
|
} |