public void forEach(Consumer<T> action) {
    for (Object[] segment : array) {
      if (segment == null) {
        return;
      }
      for (T object : (T[]) segment) {
        action.accept(object);
      }
    }
  }
Attention: the element in Array may be null!!! You have to handle this case like {@link
MapBigArray#reset()} in input action.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/aggregation/grouped/array/ObjectBigArray.java