code: private void checkFieldType(int field, Type... expected)
      {
          Type actual = getType(field);
          for (Type type : expected) {
              if (actual.equals(type)) {
                  return;
              }
          }
  
          throw new IllegalArgumentException(format("Expected field %s to be a type of %s but is %s", field, StringUtils.join(expected, ","), actual));
      }
docs: Checks that the given field is one of the provided types.
  
  @param field Ordinal of the field
  @param expected An array of expected types
  @throws IllegalArgumentException If the given field does not match one of the types