@Override
  public Object canonicalizeValue(final Object value) {
    if (isValidValue(value)) {
      return value;
    } else if (value == null) {
      throw new RuntimeException("Got invalid boolean value " + value);
    } else if (value.toString().equals(CycObjectFactory.nil.toString())) {
      return false;
    } else if (value.toString().equals(CycObjectFactory.t.toString())) {
      return true;
    } else {
      throw new RuntimeException("Got invalid boolean value " + value);
    }
  }