@Override
  public Map<String, Object> unbox() {
    if (val == null) {
      return null;
    }
    Map<String, Object> ret = new HashMap<>();
    for (Map.Entry<SelString, SelType> entry : val.entrySet()) {
      switch (entry.getValue().type()) {
        case STRING:
        case LONG:
        case DOUBLE:
        case BOOLEAN:
          ret.put(entry.getKey().getInternalVal(), entry.getValue().getInternalVal());
          break;
        case STRING_ARRAY:
        case LONG_ARRAY:
        case DOUBLE_ARRAY:
        case BOOLEAN_ARRAY:
        case MAP:
          ret.put(entry.getKey().getInternalVal(), entry.getValue().unbox());
          break;
        default:
          throw new UnsupportedOperationException(
              "Invalid type, not support having map entry value " + entry);
      }
    }
    return ret;
  }
@Test
  public void testUnbox() {
    Map<String, Object> map = orig.unbox();
    assertEquals("{foo=bar, num=123}", String.valueOf(map));
  }