public class Test {
    public static void main(String[] args) {

	LinkedList<Integer> l = new LinkedList<Integer>();

	for ( int i=0; i<1000000; i++ ) {
	    l.addFirst(new Integer(i));
	}

	System.gc();
	System.gc();
	System.gc();

	long start = System.currentTimeMillis();
	
	l.test();

	long stop = System.currentTimeMillis();

	System.out.println( "inside, time in ms is " + (stop-start) );

	System.gc();
	System.gc();
	System.gc();

	start = System.currentTimeMillis();

	Iterator<Integer> i = l.iterator();
	while (i.hasNext()) {
	    Integer x = i.next();
	}

	stop = System.currentTimeMillis();

	System.out.println( "outside (iterator), time in ms is " + (stop-start) );
    }
}
