Java 6 compatiblity in cast between generic and Integer (Histogram.java)