One of the main consequences of how lambda matching rules
panned out is that  it is in general a bad idea to overload any
method accepting a lambda.

It is only a bad idea to overload methods that take same-arity lambdas in the same position.

  removeAll(Collection)
vs
  removeAll(Predicate)

are fine (in part because null is an invalid value for both.)

I imagine that most tutorials etc
about designing with lambda will present this as the first
rule of thumb.

Dan has some rules about what constitutes valid and invalid overloadings, that have gone through a few rounds of simplification and are finally (especially with the recent overloading simplifications in the spec) that should be pretty easy to internalize.

Reply via email to