ObjectUtils.max(null,null) requires casts to agree with signature; likewise min Also use actual Date objects rather than generic Comparable.