@Override
  public <T> T get(int pos, Class<T> javaClass) {
    // struct can be null if wrap is not called first before the get call
    // or if a null struct is wrapped.
    if (struct == null) {
      return null;
    }

    int structPos = positionMap[pos];
    if (nestedProjections[pos] != null) {
      StructLike nestedStruct = struct.get(structPos, StructLike.class);
      if (nestedStruct == null) {
        return null;
      }

      return javaClass.cast(nestedProjections[pos].wrap(nestedStruct));
    }

    if (structPos != -1) {
      return struct.get(structPos, javaClass);
    } else {
      return null;
    }
  }
Creates a projecting wrapper for {@link StructLike} rows.

<p>This projection allows missing fields and does not work with repeated types like lists and
maps.

@param structType type of rows wrapped by this projection
@param projectedStructType result type of the projected rows
@return a wrapper to project rows
iceberg/patched-iceberg-api/src/main/java/org/apache/iceberg/util/StructProjection.java