Interface vs. Implementation
interface Iterator
{
boolean hasNext();
Object next();
void remove();
}

import java.util.Iterator;

class OpenListIterator implements Iterator
{
private OpenList remainder;

public OpenListIterator(OpenList theList)// constructor
    {
    remainder = theList;
    }

public boolean hasNext()
    {
    return remainder.nonEmpty();
    }

public Object next()
    {
    Object result = remainder.first();
    theList = remainder.rest();
    return result;
    }

public void remove()
    {
    throw new UnsupportedOperationException();
    }
Not good style actually;
we are forced into it if
using standard Iterator definition.