public T removeFront()
{
   T front = getFront();  // Might throw EmptyQueueException
   assert firstNode != null;
   firstNode = firstNode.getNextNode();

   if (firstNode == null)
      lastNode = null;
   else
      firstNode.setPreviousNode(null);

   return front;
} // end removeFront

public T removeBack()
{
   T back = getBack();  // Might throw EmptyQueueException
   assert lastNode != null;
   lastNode = lastNode.getPreviousNode();

   if (lastNode == null)
      firstNode = null;
   else
      lastNode.setNextNode(null);
   } // end if

   return back;
} // end removeBack
// Version 4.0
