method and unittest for converting infix expression to postfix expression