having new variable 'inter' in-between "reorder/antialias" and "hybrid" in order...
[IRC.git] / Robust / src / Tests / LinkedListTest.java
1 public class LinkedListTest {
2   public static main( String[] args ) {
3
4     LinkedList list = new LinkedList();
5     System.out.println( "list should have zero elements: "+list.size() );
6
7     list.push( (Object)new Integer( 3 ) );
8     list.push( (Object)new Integer( 4 ) );
9
10     System.out.println( "list should have two elements: "+list.size() );
11
12     Integer x = (Integer)list.pop();
13     x = (Integer)list.pop();
14
15     System.out.println( "should be a 3: "+x );
16
17     list.addLast( (Object)new Integer( 6 ) );
18     list.addLast( (Object)new Integer( 5 ) );
19     list.addLast( (Object)new Integer( 4 ) );
20     list.addLast( (Object)new Integer( 3 ) );
21
22     System.out.println( "Looking for list 6, 5, 4, 3: " );
23     System.out.print( "  " );
24     Iterator i = list.iterator();
25     while( i.hasNext() ) {
26       System.out.print( i.next() + ", " );
27     }
28     System.out.println( "" );
29
30     i = list.iterator();
31     i.next();
32     i.next();
33     i.remove();
34
35     System.out.println( "Removed 5, looking for list 6, 4, 3: " );
36     System.out.print( "  " );
37     i = list.iterator();
38     while( i.hasNext() ) {
39       System.out.print( i.next() + ", " );
40     }
41     System.out.println( "" );
42   }
43 }