class BigObjectArray<T> extends AbstractBigArray implements ObjectArray<T> {

    @SuppressWarnings("rawtypes")
    private static final BigObjectArray ESTIMATOR = new BigObjectArray(0, BigArrays.NON_RECYCLING_INSTANCE);

    private Object[][] pages;

    /** Constructor. */
    BigObjectArray(long size, BigArrays bigArrays) {
        super(OBJECT_PAGE_SIZE, bigArrays, true);
        this.size = size;
        pages = new Object[numPages(size)][];
        for (int i = 0; i < pages.length; ++i) {
            pages[i] = newObjectPage(i);
        }
    }

    @SuppressWarnings("unchecked")
    @Override
    public T get(long index) {
        final int pageIndex = pageIndex(index);
        final int indexInPage = indexInPage(index);
        return (T) pages[pageIndex][indexInPage];
    }

    @Override
    public T set(long index, T value) {
        final int pageIndex = pageIndex(index);
        final int indexInPage = indexInPage(index);
        final Object[] page = pages[pageIndex];
        @SuppressWarnings("unchecked")
        final T ret = (T) page[indexInPage];
        page[indexInPage] = value;
        return ret;
    }

    @Override
    protected int numBytesPerElement() {
        return Integer.BYTES;
    }

    /** Change the size of this array. Content between indexes <code>0</code> and <code>min(size(), newSize)</code> will be preserved. */
    @Override
    public void resize(long newSize) {<FILL_FUNCTION_BODY>}

    /** Estimates the number of bytes that would be consumed by an array of the given size. */
    public static long estimateRamBytes(final long size) {
        return ESTIMATOR.ramBytesEstimated(size);
    }

}

        final int numPages = numPages(newSize);
        if (numPages > pages.length) {
            pages = Arrays.copyOf(pages, ArrayUtil.oversize(numPages, RamUsageEstimator.NUM_BYTES_OBJECT_REF));
        }
        for (int i = numPages - 1; i >= 0 && pages[i] == null; --i) {
            pages[i] = newObjectPage(i);
        }
        for (int i = numPages; i < pages.length && pages[i] != null; ++i) {
            pages[i] = null;
            releasePage(i);
        }
        this.size = newSize;
    
<methods>public final long ramBytesEstimated(long) ,public final long ramBytesUsed() ,public abstract void resize(long) ,public final long size() <variables>private V<?>[] cache,private final non-sealed int pageMask,private final non-sealed int pageShift,private final non-sealed org.elasticsearch.common.util.PageCacheRecycler recycler,protected long size