public static void main(String args[]){
        StackWithLinkListMiddleOperation swl = new StackWithLinkListMiddleOperation();
        swl.push(1);
        System.out.println(swl.top() + " " + swl.middle());
        swl.push(2);
        System.out.println(swl.top() + " " + swl.middle());
        swl.push(3);
        System.out.println(swl.top() + " " + swl.middle());
        swl.push(4);
        System.out.println(swl.top() + " " + swl.middle());
        swl.push(5);
        System.out.println(swl.top() + " " + swl.middle());
        swl.push(6);
        System.out.println(swl.top() + " " + swl.middle());
        System.out.println("\n\n");
        swl.pop();
        System.out.println(swl.top() + " " + swl.middle());
        swl.deleteMiddle();
        System.out.println(swl.top() + " " + swl.middle());
        swl.pop();
        System.out.println(swl.top() + " " + swl.middle());
        swl.deleteMiddle();
        System.out.println(swl.top() + " " + swl.middle());
        swl.pop();
        System.out.println(swl.top() + " " + swl.middle());
        swl.deleteMiddle();
    }
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