public static Name calledMethodName(JCTree tree) {
        if (tree.getTag() == JCTree.EXEC) {
            JCExpressionStatement exec = (JCExpressionStatement)tree;
            if (exec.expr.getTag() == JCTree.APPLY) {
                Name mname = TreeInfo.name(((JCMethodInvocation) exec.expr).meth);
                return mname;
            }
        }
        return null;
    }