What is the right behavior according to JLS when methodReferenceOfNullObject() is invoked?
- throw a
NullPointerException(Oracle Java Compiler) or assign supplier to
resultthoughoisnull(Eclipse Java Compiler)public void methodReferenceOfNullObject() { Object o = nullReference(); Supplier<String> result = o::toString; // <-- point of interest ... } private Object nullReference() { return null; }