According to this SO thread, the solution is to use the non-primitive wrapper types; e.g., Integer instead of int.