public int evalRPN(String[] tokens) {
        if (tokens == null || tokens.length == 0) {
            return 0;
        }
        Stack<String> stack = new Stack<String>();
        for (int i = 0; i < tokens.length; i++) {
            String crt = tokens[i];
            if (!isOperator(crt)) {
                stack.push(crt);
            }
            else {
                int op1 = Integer.parseInt(stack.pop());
                int op2 = Integer.parseInt(stack.pop());
                stack.push(Integer.toString(calculate(op1, op2, crt)));
            }
        }
        return Integer.parseInt(stack.pop());
    }