private JCStatement makeResourceCloseInvocation(JCExpression resource) {
        // create resource.close() method invocation
        JCExpression resourceClose = makeCall(resource,
                                              names.close,
                                              List.<JCExpression>nil());
        return make.Exec(resourceClose);
    }