public class QueueDriver
{
      public static void main (String [] args)
  {
      final int SIZE = 5;  
 
           // declarations for the three objects
	   QueueAsArray myQueueAsArray;
		QueueAsArrayList myQueueAsArrayList;
		QueueAsLinkedList myQueueAsLinkedList;
		
		     // instantiations
		myQueueAsArray = new QueueAsArray(SIZE);
		myQueueAsArrayList = new QueueAsArrayList();
		myQueueAsLinkedList = new QueueAsLinkedList();
		
		// test isEmpty with empty queues (i.e. before anything queued)_
		System.out.println (" testing isEmpty with Array implementation");
		System.out.println (" Expected: true  Actual : " + myQueueAsArray.isEmpty());
		System.out.println ();
		
		
		System.out.println (" testing isEmpty with ArrayList implementation");
		System.out.println (" Expected: true  Actual : " + myQueueAsArrayList.isEmpty());
		System.out.println ();

		System.out.println (" testing isEmpty with linked list implementation");
		System.out.println (" Expected: true  Actual : " + myQueueAsLinkedList.isEmpty());
		System.out.println ();
		
		// test isFull with empty queues (i.e. before anything queued)
	   System.out.println (" testing isFull with Array implementation");
		System.out.println (" Expected: false  Actual : " + myQueueAsArray.isFull());
		System.out.println ();
		
		
		System.out.println (" testing isFull with ArrayList implementation");
		System.out.println (" Expected: false  Actual : " + myQueueAsArrayList.isFull());
		System.out.println ();

		System.out.println (" testing isFull with linked list implementation");
		System.out.println (" Expected: false  Actual : " + myQueueAsLinkedList.isFull());
		System.out.println ();
		
		// test first when list is empty (i.e. before queuing anything)
      System.out.println (" testing first with Array implementation");
		System.out.println (" Expected: empty queue  Actual : " + myQueueAsArray.first());
		System.out.println ();
		
		
		System.out.println (" testing first with ArrayList implementation");
		System.out.println (" Expected: empty queue  Actual : " + myQueueAsArrayList.first());
		System.out.println ();

 		System.out.println (" testing first with linked list implementation");
		System.out.println (" Expected: empty queue  Actual : " + myQueueAsLinkedList.first());
		System.out.println ();
		
		// test enqueue on empty list

		if (!myQueueAsArray.isFull()) // if queue not full
      {
		   myQueueAsArray.enqueue(new Customer ("array1"));
  		   System.out.println (" adding Customer array1 to queue ");
	   }
		else   //don't want to enqueue on a full list
		   System.out.println (" queue full can't add ");
 
      if (!myQueueAsArrayList.isFull())// if queue not full
		{
		   myQueueAsArrayList.enqueue (new Customer ("arrayList1"));
			System.out.println (" adding Customer arrayList1 to queue ");
		}
		else  // don't want to enqueue on a full list
		   System.out.println (" queue full can't add ");

	   if (! myQueueAsLinkedList.isFull()) // queue not full
		{
		   myQueueAsLinkedList.enqueue (new Customer ("linkedList1"));
 		   System.out.println (" adding Customer linkedList1 to queue ");		
		}
		else  // don't want to enqueue on a full list
		   System.out.println (" queue full can't add ");
	
				// test first after inserting an element
      System.out.println (" testing first with Array implementation");
		System.out.println (" Expected: array1  Actual : " + myQueueAsArray.first());
		System.out.println ();
		
		
		System.out.println (" testing first with ArrayList implementation");
		System.out.println (" Expected: arrayList1  Actual : " + myQueueAsArrayList.first());
		System.out.println ();

 		System.out.println (" testing first with linked list implementation");
		System.out.println (" Expected: linkedList1  Actual : " + myQueueAsLinkedList.first());
		System.out.println ();

		// test enqueue on non-empty list
		
		if (!myQueueAsArray.isFull()) // queue not full so enqueue
		{
		    myQueueAsArray.enqueue(new Customer("array2"));
			 System.out.println (" adding Customer array2 to queue ");
		}	 
		else  // don't want to enqueue on a full queue
			System.out.println (" queue full, can't add ");
		
      if (!myQueueAsArrayList.isFull()) // queue not full so enqueue
		{
    		myQueueAsArrayList.enqueue (new Customer( "arrayList2"));
		   System.out.println (" adding Customer arrayList2 to queue ");
		}
		else  // don't want to enqueue on a full queue
		   System.out.println (" queue full can't add ");
		 
		if (!myQueueAsLinkedList.isFull()) // queue not full so can enqueue
		{ 
		   myQueueAsLinkedList.enqueue (new Customer ("linkedList2"));
			System.out.println (" adding Customer linkedList2 to queue ");
		}
		else  // don't want to enqueue on a full queue
		   System.out.println (" queue full can't add");

				// test first after inserting 2nd element
      System.out.println (" testing first with Array implementation");
		System.out.println (" Expected: array1  Actual : " + myQueueAsArray.first());
		System.out.println ();
		
		
		System.out.println (" testing first with ArrayList implementation");
		System.out.println (" Expected: arrayList1  Actual : " + myQueueAsArrayList.first());
		System.out.println ();

 		System.out.println (" testing first with linked list implementation");
		System.out.println (" Expected: linkedList1  Actual : " + myQueueAsLinkedList.first());
		System.out.println ();

      // adding more elements to the implementation which can become full

		if (!myQueueAsArray.isFull()) // not full can enqueue
      {
		   myQueueAsArray.enqueue(new Customer ("array3"));
  		   System.out.println (" adding Customer array3 to queue ");
			System.out.println ();
	   }
		else  // queue full don't enqueue
		{
		   System.out.println (" queue full can't add ");
      }

      System.out.println (" trying to add 4th element ");
		if (myQueueAsArray.isFull()) // don't want to enqueue if queue full
      {
		   System.out.println (" queue full can't add ");
			System.out.println ();   	  
	   }
		else  // queue not full, okay to enqueue
	   {
		   myQueueAsArray.enqueue(new Customer ("array4"));
  		   System.out.println (" adding Customer array4 to queue ");
			System.out.println();

      }
		
      System.out.println (" trying to add 5th element ");
		if (myQueueAsArray.isFull()) // if full don't want to enqueue
      {
		   System.out.println (" queue full can't add ");
			System.out.println();
		}
		else  // queue not full okay to enqueue
		{
		   myQueueAsArray.enqueue(new Customer ("array5"));
  		   System.out.println (" adding Customer array5 to queue ");
			System.out.println ();
		}

      System.out.println (" trying to add 6th element ");
		if (myQueueAsArray.isFull()) // if full don't want to enqueue
  		{
		   System.out.println (" queue full can't add ");
			System.out.println ();
		}	
		else // queue not full okay to enqueue
		{
		   myQueueAsArray.enqueue(new Customer ("array6"));
  		   System.out.println (" adding Customer array6 to queue ");
			System.out.println ();
	   }

      System.out.println (" trying to add 7th element ");
		if (myQueueAsArray.isFull())// if full don't want to enqueue
      {
         System.out.println (" queue full can't add ");
			System.out.println();
		}
		else // queue not full okay to enqueue
		{
		   myQueueAsArray.enqueue(new Customer ("array7"));
  		   System.out.println (" adding Customer array7 to queue ");
			System.out.println();
	   }
	
	      // testing dequeue
	    // dequeue queue until it's empty - don't care that it will be gone
       System.out.println (" dequeuing the entire queue implemented as an array ");
       while (!(myQueueAsArray.isEmpty())) // while there are elements left in queue
		 {
		    System.out.print(myQueueAsArray.first()+ " "); // get first element
	 	    myQueueAsArray.dequeue(); // delete it
		 }
		 System.out.println (); 
		 System.out.println ();
		 
		 System.out.println  (" dequeuing the entire queue implemented as an ArrayList ");
       while (!(myQueueAsArrayList.isEmpty())) // while there are elements left in queue
		 {
		    System.out.print(myQueueAsArrayList.first()+ " "); // get first element
	 	    myQueueAsArrayList.dequeue();  // delete it
		 }
		 System.out.println (); 
		 System.out.println ();

		 System.out.println (" dequeuing the entire queue implemented as an LinkedList ");
       while (!(myQueueAsLinkedList.isEmpty()))// whle there are elements left
		 {
		    System.out.print(myQueueAsLinkedList.first()+ " "); // get first element
	 	    myQueueAsLinkedList.dequeue(); // delete if
		 }
		 System.out.println (); 


   } // end main
} // end QueueDriver 
