IMHO, this is a non-sense, casting to Integer together with autoboxing would be fine, but I know no single case when this compiles without warning and without error.
final Map<String, Integer> m1 = new HashMap<String, Integer>();
m1.put("a", 42); // autoboxing
final int n = (int) m1.get(42); // WARNING: Unnecessary cast from Integer to int
final Map<String, Long> m2 = new HashMap<String, Long>();
m2.put("a", 43L); // autoboxing
final int n2 = (int) (long) m2.get(42); // fine
final int n2a = (int) m2.get(42); // ERROR: Cannot cast from Long to int
final Map<String, Object> m3 = new HashMap<String, Object>();
m3.put("a", 43); // autoboxing
final int n3 = (Integer) m3.get(42); // fine
final int n3a = (int) m3.get(42); // ERROR: Cannot cast from Object to int
Maybe it was a cast to Integer?