.Long cannot be cast to java.lang.Integer code example Example: java.lang.long cannot be cast to java.lang.integer Long.valueOf(x).intValue()