Yes, lambdas return the last expression. `Unit` is...
# getting-started
k
Yes, lambdas return the last expression.
Unit
is basically
Void
, but the Java compiler doesn't know that. What it sees is "I need to provide a lambda that returns an instance of some type that some 3rd-party library is providing". In this case being Unit, of course, so you'd use
Unit.INSTANCE
.