import hlt.osf.util.DoublyLinkedList;

public class Test
{
  final public static void main (String args[])
  {
    System.out.println();
    System.out.println("Testing the class hlt.osf.util.DoublyLinkedList");
    System.out.println();

    System.out.println();
    System.out.println("Testing the constructor DoublyLinkedList()");
    System.out.println();

    DoublyLinkedList dl1 = new DoublyLinkedList();

    System.out.println();
    System.out.println("Testing the DoublyLinkedList.append(String) method");
    System.out.println();

    dl1.append("a");
    dl1.append("b");
    dl1.append("c");
    dl1.append("d");
    dl1.append("e");    

    System.out.println();
    System.out.println("Testing the DoublyLinkedList.toString() method");
    System.out.println();

    System.out.println();
    System.out.println("dl1 = "+dl1);
    System.out.println();
    System.out.println("Testing the DoublyLinkedList.firstElt() method");
    System.out.println("dl1.firstElt() = "+dl1.firstElt());
    System.out.println();

    System.out.println();
    System.out.println("Testing the DoublyLinkedList.lastElt() method");
    System.out.println("dl1.lastElt() = "+dl1.lastElt());
    System.out.println();

    System.out.println();
    System.out.println("Testing the DoublyLinkedList.length() method");
    System.out.println("dl1.length = "+dl1.length());
    System.out.println();

    System.out.println();
    System.out.println("Testing the DoublyLinkedList.copy() method");
    DoublyLinkedList dl2 = dl1.copy();
    System.out.println("dl2 = dl1.copy()");
    System.out.println("dl2 = "+dl2);
    System.out.println();

    System.out.println();
    System.out.println("Testing the copy");

    System.out.println("dl2.firstElt() = "+dl2.firstElt());
    System.out.println("dl2.lastElt() = "+dl2.lastElt());
    System.out.println("dl2.length() = "+dl2.length());

    System.out.println();
    System.out.println("Testing the in-place DoublyLinkedList.concatenate(String) method");
    dl1.concatenate(dl2);
    System.out.println("dl1.concatenate(dl2)");
    System.out.println("dl1 = "+dl1);
    System.out.println("dl1.firstElt() = "+dl1.firstElt());
    System.out.println("dl1.lastElt() = "+dl1.lastElt());
    System.out.println("dl1.length() = "+dl1.length());
    System.out.println();
    System.out.println("dl2 = "+dl2);
    System.out.println("dl2.first = "+dl2.firstElt());
    System.out.println("dl2.last = "+dl2.lastElt());
    System.out.println("dl2.length = "+dl2.length());

  }
}
