The Java language automatically converts primitive types to their boxed representations in some contexts (see JLS 5.1.7).
That is, prefer this:
int x;
Integer y = x;
to the equivalent but more verbose explicit conversion:
int x;
Integer y = Integer.valueOf(x);
Suppress false positives by adding the suppression annotation @SuppressWarnings("UnnecessaryBoxedAssignment")
to the enclosing element.