l1 instanceof Long
since l1 null , instanceof gives false (as indicated by the Java languange specs)
l2 instanceof Long
this gives false since you are using the wrong getLong method:
Determines the long value of the system property with the specified name.
source share