public class Test {

    public static void main (String[] args) {

	// note: the following is a really bad way to build a list.
	// warning signs of badness: allocating two different kinds
	// of objects, accessing the instance variables of another class,
	// using the constant 3 to set the length

	// create an empty list
	LinkedList list = new LinkedList ();

	// create three new nodes, unlinked
	Node node1 = new Node ();
	node1.cargo = 1;

	Node node2 = new Node ();
	node2.cargo = 2;

	Node node3 = new Node ();
	node3.cargo = 3;

	// next up the nodes
	node1.next = node2;
	node2.next = node3;
	node3.next = null;

	list.head = node1;
	list.length = 3;

	list.print ();
	list.printBackward ();
    }
}
