The static type checked cannot choose which variant of a overloaded method with both primitive and object parameters (e.g. long and Long) to use when the actual type of the parameter is the object type (e.g. Long):
yields the following compilation error:
The problem can be worked around by explicitely calling .longValue() on the Long.