Throw ClassCastException when comparing incompatible ranges types