/** Implements the FancyList interface as a doubly-linked list * that extends NodeList with additional methods. See the * interface's documentation for explanation of what the methods do. */ import java.util.Iterator; public class FancyNodeList extends NodeList implements FancyList { public FancyList append_destructive(List l) { NodeList second = (NodeList)l; // may throw a ClassCastException, as documented // fill this in } public FancyList reverse_destructive() { // fill this in } // These methods just call the constructors for the iterator classes // that you will write. public Iterator iterator() { return (new FancyListIterator(this)); } public Iterator iteratorReverse() { return (new FancyListReverseIterator(this)); } public Iterator iteratorSorted() { return (new FancyListSortedIterator(this)); } }