/** * Removes and returns the current item from the stream. * <p>After this method was called, all calls to {@link #current()} will then return the item, which * was previously returned by {@link #next()} * * @return the item which is being removed from the stream */ public T consume() { T result = current(); consume(1); return result; }
/** * Removes and returns the current item from the stream. * <p>After this method was called, all calls to {@link #current()} will then return the item, which * was previously returned by {@link #next()} * * @return the item which is being removed from the stream */ public T consume() { T result = current(); consume(1); return result; }