class GridH2Cursor implements Cursor {
    /** */
    public static final Cursor EMPTY = new Cursor() {
        @Override public Row get() {
            return null;
        }

        @Override public SearchRow getSearchRow() {
            return null;
        }

        @Override public boolean next() {
            return false;
        }

        @Override public boolean previous() {
            return false;
        }
    };

    /** */
    protected Iterator<? extends Row> iter;

    /** */
    protected Row cur;

    /**
     * Constructor.
     *
     * @param iter Rows iterator.
     */
    public GridH2Cursor(Iterator<? extends Row> iter) {
        assert iter != null;

        this.iter = iter;
    }

    /** {@inheritDoc} */
    @Override public Row get() {
        return cur;
    }

    /** {@inheritDoc} */
    @Override public SearchRow getSearchRow() {
        return get();
    }

    /** {@inheritDoc} */
    @Override public boolean next() {<FILL_FUNCTION_BODY>}

    /** {@inheritDoc} */
    @Override public boolean previous() {
        // Should never be called.
        throw DbException.getUnsupportedException("previous");
    }
}

        cur = iter.hasNext() ? iter.next() : null;

        return cur != null;
    
<no_super_class>