@SuppressWarnings("unchecked")
  public static SelType box(Object o) {
    if (o == null) { // returned null from a method, representing void or object
      return SelType.NULL;
    }
    SelTypes type = fromClazzToSelType(o.getClass());
    switch (type) {
      case STRING:
        return SelString.of((String) o);
      case LONG:
        return SelLong.of(((Number) o).longValue());
      case DOUBLE:
        return SelDouble.of(((Number) o).doubleValue());
      case BOOLEAN:
        return SelBoolean.of((Boolean) o);
      case STRING_ARRAY:
      case LONG_ARRAY:
      case DOUBLE_ARRAY:
      case BOOLEAN_ARRAY:
        return SelArray.of(o, type);
      case MAP:
        return SelMap.of((Map<String, Object>) o);
      case DATETIME:
        return SelJodaDateTime.of((DateTime) o);
      case DATETIME_PROPERTY:
        return SelJodaDateTimeProperty.of((DateTime.Property) o);
    }
    throw new UnsupportedOperationException(
        "Not support to box an object " + o + " for type " + type.name());
  }
@Test
  public void testBoxUnsupported() {
    Object[] testObjects =
        new Object[] {
          DateTimeZone.forID("UTC"),
          DateTimeFormat.forPattern("yyyy"),
          Days.days(1),
          new SimpleDateFormat("yyyyMMdd"),
          new Date(12345),
          new ArrayList()
        };
    for (int i = 0; i < testObjects.length; ++i) {
      try {
        SelTypeUtil.box(testObjects[i]);
      } catch (UnsupportedOperationException e) {
        // expected
      }
    }
  }