GcsUtil { List<BatchRequest> makeRemoveBatches(Collection<String> filenames) throws IOException { List<BatchRequest> batches = new ArrayList<>(); for (List<String> filesToDelete : Lists.partition(Lists.newArrayList(filenames), MAX_REQUESTS_PER_BATCH)) { BatchRequest batch = createBatchRequest(); for (String file : filesToDelete) { enqueueDelete(GcsPath.fromUri(file), batch); } batches.add(batch); } return batches; } private  GcsUtil(
      Storage storageClient,
      HttpRequestInitializer httpRequestInitializer,
      ExecutorService executorService,
      Boolean shouldUseGrpc,
      @Nullable Integer uploadBufferSizeBytes); static String getNonWildcardPrefix(String globExp); static boolean isWildcard(GcsPath spec); List<GcsPath> expand(GcsPath gcsPattern); long fileSize(GcsPath path); StorageObject getObject(GcsPath gcsPath); List<StorageObjectOrIOException> getObjects(List<GcsPath> gcsPaths); Objects listObjects(String bucket, String prefix, @Nullable String pageToken); Objects listObjects(
      String bucket, String prefix, @Nullable String pageToken, @Nullable String delimiter); SeekableByteChannel open(GcsPath path); WritableByteChannel create(GcsPath path, String type); WritableByteChannel create(GcsPath path, String type, Integer uploadBufferSizeBytes); boolean bucketAccessible(GcsPath path); long bucketOwner(GcsPath path); void createBucket(String projectId, Bucket bucket); void copy(Iterable<String> srcFilenames, Iterable<String> destFilenames); void remove(Collection<String> filenames);  }
@Test public void testMakeRemoveBatches() throws IOException { GcsUtil gcsUtil = gcsOptionsWithTestCredential().getGcsUtil(); List<BatchRequest> batches = gcsUtil.makeRemoveBatches(makeStrings("s", 3)); assertThat(batches.size(), equalTo(1)); assertThat(sumBatchSizes(batches), equalTo(3)); batches = gcsUtil.makeRemoveBatches(makeStrings("s", 100)); assertThat(batches.size(), equalTo(1)); assertThat(sumBatchSizes(batches), equalTo(100)); batches = gcsUtil.makeRemoveBatches(makeStrings("s", 501)); assertThat(batches.size(), equalTo(6)); assertThat(sumBatchSizes(batches), equalTo(501)); }