Avoid unnecessary boxing by using plain == for primitive types.

See: https://errorprone.info/bugpattern/ObjectEqualsForPrimitives