Just guess here, but it may be that 1L is in a constant pool, and therefore referential equality evaluates to true (just like sometimes even Strings, == will evaluate to true), while the other huge numbers are not. You do not know how to check which constants are in the pool during initialization.
Edit: Java has a cache of defined constant objects (including wrapper classes for primitives and String). So if you write
String st1 = "A";
if "A" is in a constant pool, Java will not create a new String object - it will simply create a link to an existing one. So if you did then
String st2 = "A"; System.out.println(st1 == st2);
He will print the truth.
Now not all are integers, long, short, etc. cached (there are too many), but lower values. Therefore, I would suggest that 1L is. This means that in your question, both another and one refer to the same object, and thus it returns true even for reference equality.
source share