public List<String> toPrefix(String in) {
        List<String> tokens = buildTokens(alignINClause(in));

        List<String> output = new ArrayList<>();
        List<String> stack = new ArrayList<>();
        for (String token : tokens) {
            if (isOperand(token)) {
                if (token.equals(")")) {
                    while (openParanthesesFound(stack)) {
                        output.add(stack.remove(stack.size() - 1));
                    }
                    if (!stack.isEmpty()) {
                        // temporarily fix for issue #189
                        stack.remove(stack.size() - 1);
                    }
                } else {
                    while (openParanthesesFound(stack) && !hasHigherPrecedence(token, stack.get(stack.size() - 1))) {
                        output.add(stack.remove(stack.size() - 1));
                    }
                    stack.add(token);
                }
            } else {
                output.add(token);
            }
        }
        while (!stack.isEmpty()) {
            output.add(stack.remove(stack.size() - 1));
        }
        return output;
    }
@Test
    public void testTwoInnerParenthesis() {
        String query = "a and b AND ( ( ( a > c AND b > d ) OR ( x = y ) ) ) OR t > u";
        List<String> list = parser.toPrefix(query);
        assertEquals(Arrays.asList("a", "b", "and", "a", "c", ">", "b", "d", ">", "AND", "x", "y", "=", "OR", "AND", "t", "u",
                ">", "OR"), list);
    }