@SuppressWarnings("unchecked")
    public boolean delete( Comparable key ) {
        ListNode<T> before = null;
        ListNode<T> after = front;   
        
        // Traverse the list to find the ListNode before and after our deletion point.
        while ((after != null) && (key.compareTo(after.getData()) != 0)) {
            before = after;
            after = after.getNext();
        }
        
        if (after == null)
            return false;
        else
            after = after.getNext();
        
        // Delete the node by linking before to the next node of after
        if (size() == 1 || before == null)
            front = after;
        else 
            before.setNext(after);
        
        numberOfNodes--;
        return true;
    }