final String spreadsheetId = "my spreadsheetId";
List<Request> requests = new ArrayList<>();
SheetProperties sheetProperties = new SheetProperties().setTitle("New Sheet");
requests.add(new Request().setAddSheet(new AddSheetRequest().setProperties(sheetProperties)));
BatchUpdateSpreadsheetRequest requestBody = new BatchUpdateSpreadsheetRequest();
requestBody.setRequests(requests);
Sheets.Spreadsheets.BatchUpdate request = service.spreadsheets().batchUpdate(spreadsheetId, requestBody);
BatchUpdateSpreadsheetResponse response = request.execute();
Recommended Posts