public int deleteMiddle(){
        if(size == 0){
            throw new IllegalArgumentException();
        }
        size--;
        if(middle == head){
            int data = middle.data;
            middle = middle.next;
            head = head.next;
            if(head != null){
                head.before = null;
            }
            return data;
        }
        
        if(size % 2 == 0){
            int data = middle.data;
            Node next = middle.next;
            middle = middle.before;
            middle.next = next;
            if(next != null){
                next.before = middle;
            }
            return data;
        }
        else{
            int data = middle.data;
            Node before = middle.before;
            middle = middle.next;
            middle.before = before;
            if(before != null){
                before.next = middle;
            }
            return data;
        }
    }
http://www.geeksforgeeks.org/design-a-stack-with-find-middle-operation/
Test cases:
Delete middle with 1,2,3 element
Pop with 1,2,3 elements
Delete or pop when empty stack
src/com/interview/linklist/StackWithLinkListMiddleOperation.java