@Override
  public boolean equals(Object other) {
    if (this == other) {
      return true;
    } else if (!(other instanceof StructLikeWrapper)) {
      return false;
    }

    StructLikeWrapper that = (StructLikeWrapper) other;

    if (this.struct == that.struct) {
      return true;
    }

    if (this.struct == null ^ that.struct == null) {
      return false;
    }

    return comparator.compare(this.struct, that.struct) == 0;
  }
Creates a copy of this wrapper that wraps a struct.

<p>This is equivalent to {@code new StructLikeWrapper(type).set(newStruct)} but is cheaper
because no analysis of the type is necessary.

@param newStruct a {@link StructLike} row
@return a copy of this wrapper wrapping the give struct
iceberg/patched-iceberg-core/src/main/java/org/apache/iceberg/util/StructLikeWrapper.java