How to autocomplete lambdas in IntelliJ IDEA?
In Windows or Linux, it’s Ctrl+Space
In Mac OS, it’s Ctrl+Shift+Space
You can just type p = s -> f...
, autocompletion will then suggest false
. If you're not sure about lambda, you can start with the inner class, and then turn it into a lambda expression.
In your example you can press Alt+Enter afterwards, as follows:
After completing:
After pressing Alt+Enter:
Result:
Clicking the small icon at the gutter shows you the Predicate.test
method.