Objects.hashCode takes an Object parameter, and will either return 0 when the parameter is null, or call the underlying hashCode function of the Object reference.
Passing a primitive value to Objects.hashCode function results in boxing the primitive, then calling the boxed object’s hashCode. You can get the same result by using, e.g.: Long.hashCode(long) to get the effective hash code of a primitive long. If you’re calling this method outside of your own hashCode() implementation, prefer to use the BoxedClass.hashCode(primitive) functions to avoid unwanted boxed.
// fields to the hash call), but comes at a potential performance penalty.
// hash code of the underlying intValue.
Suppress false positives by adding the suppression annotation @SuppressWarnings("ObjectsHashCodePrimitive") to the enclosing element.