I recently ran in to a weird issue where tests were failing on our Bamboo box, but not on dev boxes. After a lot of debugging we found out that the cause was due to using a == on a Long instead of .equals. Once I figured it out it made sense, but I was surprised that the no developer could recreate this, but it always happened on the build box.
For our tests it would be nice to catch these kinds of things and try to prevent == where it wasn't intended, but I am not aware of a way to tell Java don't intern Longs, Strings, etc... Is there a setting you can give to the JVM to handle this?