Since they are cached, we can do a 

    AtomicLong ref1 = ....getLong(...)
    AtomicLong ref2 = ... getLong(...)
    assertSame(ref1, ref2)

And there is no need to deal with hashcode and equals anymore, since same instance implies no equals and hashcode problem.