class RowCollectExpression implements CollectExpression<Row, Object> {

    private final int index;
    private Object value;

    public RowCollectExpression(int index) {
        this.index = index;
    }

    @Override
    public void setNextRow(Row row) {<FILL_FUNCTION_BODY>}

    @Override
    public Object value() {
        return value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RowCollectExpression that = (RowCollectExpression) o;

        if (index != that.index) return false;
        if (value != null ? !value.equals(that.value) : that.value != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = index;
        result = 31 * result + (value != null ? value.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "RowCollectExpression{idx=" + index + '}';
    }
}

        assert row.numColumns() > index
            : "Wanted to retrieve value for column at position=" + index + " from row=" + row + " but row has only " + row.numColumns() + " columns";
        value = row.get(index);
    
<no_super_class>