code: @Override
      public ValueComparator compare(Value o) {
          if (o == null) {
              return ValueComparator.NOT_EQUAL_TO;
          }
          switch (o.getType()) {
              case NUMBERVALUE:
                  NumberValue other = (NumberValue) o;
                  int comp = compareTo(other);
                  return comp > 0 ? ValueComparator.GREATER_THAN
                          : (comp < 0 ? ValueComparator.LESS_THAN
                                  : ValueComparator.EQUAL_TO);
              case INEQUALITYNUMBERVALUE:
                  InequalityNumberValue other2 = (InequalityNumberValue) o;
                  int comp2 = num.compareTo((BigDecimal) other2.getNumber());
                  switch (other2.getComparator()) {
                      case EQUAL_TO:
                          return comp2 > 0 ? ValueComparator.GREATER_THAN
                                  : (comp2 < 0 ? ValueComparator.LESS_THAN
                                          : ValueComparator.EQUAL_TO);
                      case GREATER_THAN:
                          return comp2 <= 0 ? ValueComparator.LESS_THAN
                                  : ValueComparator.UNKNOWN;
                      default:
                          return comp2 >= 0 ? ValueComparator.GREATER_THAN
                                  : ValueComparator.UNKNOWN;
                  }
              case VALUELIST:
                  ValueList<?> vl = (ValueList<?>) o;
                  return equals(vl) ? ValueComparator.EQUAL_TO
                          : ValueComparator.NOT_EQUAL_TO;
              default:
                  return ValueComparator.NOT_EQUAL_TO;
          }
      }
docs: Compares this value and another numerically, or checks this number value
  for membership in a value list.
  
  @param o a {@link Value}.
  @return If the provided value is a {@link NumericalValue}, returns null     {@link ValueComparator#GREATER_THAN},
  {@link ValueComparator#LESS_THAN} or {@link ValueComparator#EQUAL_TO}
  depending on whether this value is numerically greater than, less than or
  equal to the value provided as argument. If the provided value is a
  {@link ValueList}, returns {@link ValueComparator#IN} if this object is a
  member of the list, or {@link ValueComparator#NOT_IN} if not. Otherwise,
  returns {@link ValueComparator#UNKNOWN}.