private Comparable<?> castToComparable(Object value){
  try {
    return (Comparable<?>)value;
  }
 catch (  ClassCastException e) {
    throw new IllegalArgumentException("Contains operator requires a Comparable class type.",e);
  }
}

private Comparable < ? > castToComparable ( Object value ) { try { return ( Comparable < ? > ) value ; } catch ( ClassCastException e ) { throw new IllegalArgumentException ( "Contains operator requires a Comparable class type." , e ) ; } }
cast the provided object to comparable . relevant for " > " , " < " , " < = " & " > = " operators .
