Since JDK-8143896 not all instances of java.lang.Number are treated as primitive numbers anymore in Nashorn. This affects java longs/Long and all classes implementing java.lang.Number that do not directly represent wrappers of Java primitives.
However, these Number objects should still convert to JS numbers when passed to the ECMAScript ToPrimitive with Number hint. This would allow to compare these objects numerically in <, <=, >=, and > operators.
Currently, the code below prints "false" because Longs are converted to strings:
l1 = new java.lang.Long(2), l2 = new java.lang.Long(10);
print(l1 < l2);