public static JCMethodInvocation firstConstructorCall(JCTree tree) {
        if (tree.getTag() != JCTree.METHODDEF) return null;
        JCMethodDecl md = (JCMethodDecl) tree;
        Name.Table names = md.name.table;
        if (md.name != names.init) return null;
        if (md.body == null) return null;
        List<JCStatement> stats = md.body.stats;
        // Synthetic initializations can appear before the super call.
        while (stats.nonEmpty() && isSyntheticInit(stats.head))
            stats = stats.tail;
        if (stats.isEmpty()) return null;
        if (stats.head.getTag() != JCTree.EXEC) return null;
        JCExpressionStatement exec = (JCExpressionStatement) stats.head;
        if (exec.expr.getTag() != JCTree.APPLY) return null;
        return (JCMethodInvocation)exec.expr;
    }