Code example for Iterator

Methods: hasNext, next

0
        this.actions = new ArrayList<Action>(Arrays.asList(actions));
        this.iterator = this.actions.iterator();
    } 
     
    public Object invoke(Invocation invocation) throws Throwable {
        if (iterator.hasNext()) {
            return iterator.next().invoke(invocation);
        }  
    	throw ExpectationError.unexpected("no more actions available", invocation);
    } 
     
    public void describeTo(Description description) {
        description.appendList("", ", and then ", "", actions);
    } 
}