list.stream()
.filter(name -> name.startsWith("f"))
.map(String::toUpperCase)
.sorted()
.forEach(System.out::println);
The whole idea of Java streams is to enable functional-style operations on streams of elements, using Lambda experession and Method reference.
Method references are a special type of lambda expressions
In functional-style operations the execution is performed from left to right that means
stream() is called on result of list
filter() is called on result of list.stream()
map() is called on result of list.stream().filter(name -> name.startsWith("f"))
sorted() is called on result of list.stream().filter(name -> name.startsWith("f")).map(String::toUpperCase)
forEach is called on the result of list.stream().filter(name -> name.startsWith("f")).map(String::toUpperCase).sorted()
To explore your knowledge you can read from Oracle Java (version 8 onward) Documents
Specially for the topics Lambda expression and method reference :-
1. Lamda Expression
2. Method Reference