class SheetsHelper {

    public Spreadsheet getSpreadsheet(String spreadsheetId) throws IOException {

        /*
         * Read permission check
         *
         * To check read permissions, we are trying to fetch the complete spreadsheet using the
         * given spreadsheet id
         */

        // fetching the google spreadsheet
        Spreadsheet spreadsheet = sheetsService.getSpreadsheet(spreadsheetId);

        String spreadsheetFileName = spreadsheet.getProperties().getTitle();

        /*
         * Write permission check
         *
         * To check write permissions, we are trying to overwrite the name of the spreadsheet with
         * the same name
         *
         * Todo 22/3/17 Find a better way to check the write permissions
         */

        // creating a request to update name of spreadsheet
        SpreadsheetProperties sheetProperties = new SpreadsheetProperties()
                .setTitle(spreadsheetFileName);

        List<Request> requests = new ArrayList<>();
        requests.add(
                new Request().setUpdateSpreadsheetProperties(
                        new UpdateSpreadsheetPropertiesRequest()
                                .setProperties(sheetProperties)
                                .setFields("title")));

        // updating the spreadsheet with the given id
        sheetsService.batchUpdate(spreadsheetId, requests);
        return spreadsheet;
    }

      SheetsHelper(GoogleAccountCredential credential, HttpTransport transport, JsonFactory jsonFactory);
      SheetsHelper(@NonNull SheetsService sheetsService);

}