Which portion of code can be removed so that this line of code continues to compile?
Predicate<StringBuilder> p = (StringBuilder b) -> {return true;};
D.
Option A is tricky, but incorrect.
While a lambda can have zero parameters, a Predicate cannot.
A Predicate is defined as a type mapping to a boolean.
Option B is clearly incorrect as -> separates the parts of a lambda.
Options C and D are similar.
Option C is incorrect because return is only allowed when the brackets are present.
Option D is correct.