import DataStructures.*; import Exceptions.*; // Simple test program for lists public final class TestList { public static void main( String [ ] args ) { List theList = new LinkedList( ); ListItr itr = new LinkedListItr( theList ); // Repeatedly insert new items as first elements for( int i = 0; i < 5; i++ ) { try { itr.insert( new Integer( i ) ); } catch( ItemNotFound e ) { } // Cannot happen itr.zeroth( ); // Reset Itr to the start } System.out.print( "Contents:" ); for( itr.first( ); itr.isInList( ); itr.advance( ) ) System.out.print( " " + itr.retrieve( ) ); System.out.println( " end" ); } }