"It is rarely appropriate to use this constructor. The static factory valueOf(int) is generally a better choice, as it is likely to yield significantly better space and time performance."
Coverage remained the same at 68.578% when pulling 44a526222ce80a320196e6c48f1fc9489a2fd4e9 on ullenius:autoboxing into 7dbd34778e5b9ae498bb4efecb8d25d5e26ceb55 on mpatric:master.
Replaced Integer with primitive type int.
No need for primitive type wrapper as Java does autoboxing (when using the value as a key for the HashMap)
In this method the value can never be null since the method parameter defines an int (primitive type). Thus Integer is not needed
Since Integer is immutable
final int
was used to clarify that this value will never be changed.The Integer(int value) constructor is deprecated as of Java 9. The Javadocs(https://docs.oracle.com/javase/9/docs/api/java/lang/Integer.html#Integer-int-) state: