class TypedCellsAccounting implements RowAccounting<Object[]> {

    private final RamAccounting ramAccounting;
    private final int extraSizePerRow;
    private final CellsSizeEstimator sizeEstimator;

    /**
     * @param columnTypes     Column types to use for size estimation
     * @param ramAccounting   {@link RamAccounting} implementing the CircuitBreaker logic
     * @param extraSizePerRow Extra size that need to be calculated per row. E.g. {@link HashInnerJoinBatchIterator}
     *                        might instantiate an ArrayList per row used for the internal hash->row buffer
     */
    public TypedCellsAccounting(List<? extends DataType<?>> columnTypes,
                                RamAccounting ramAccounting,
                                int extraSizePerRow) {
        this.sizeEstimator = CellsSizeEstimator.forColumns(columnTypes);
        this.ramAccounting = ramAccounting;
        this.extraSizePerRow = extraSizePerRow;
    }

    /**
     * Account for the size of the values of the row cells (this can include all the output cells, not just the source
     * row).
     * <p>
     * This should only be used if the values are stored/buffered in another in-memory data structure.
     */
    @Override
    public long accountForAndMaybeBreak(Object[] rowCells) {<FILL_FUNCTION_BODY>}

    @Override
    public void release() {
        ramAccounting.release();
    }
}

        long rowBytes = sizeEstimator.estimateSize(rowCells) + extraSizePerRow;
        ramAccounting.addBytes(rowBytes);
        return rowBytes;
    
<no_super_class>