The second one will effectively use the jvm's integer cache, thus it will be better both in performance, as well as a best practice (do not instantiate boxed types, rather let the vm do that for you).
You could imitate the same behavior if you changed the new Integer(in) with Integer.valueOf(in)