static long sizeOf(Mutation m) {
    if (m.getOperation() == Mutation.Op.DELETE) {
      return sizeOf(m.getKeySet());
    }
    long result = 0;
    for (Value v : m.getValues()) {
      switch (v.getType().getCode()) {
        case ARRAY:
          result += estimateArrayValue(v);
          break;
        case STRUCT:
          throw new IllegalArgumentException("Structs are not supported in mutation.");
        default:
          result += estimatePrimitiveValue(v);
      }
    }
    return result;
  }
@Test(expected = IllegalArgumentException.class)
  public void unsupportedArrayType() {
    Mutation unsupportedArray =
        Mutation.newInsertOrUpdateBuilder("test")
            .set("one")
            .toStructArray(
                Type.struct(Type.StructField.of("int64", Type.int64())), ImmutableList.of())
            .build();
    MutationSizeEstimator.sizeOf(unsupportedArray);
  }