code: public Bucket enableRequesterPays(String bucketName) throws StorageException {
      // [START enable_requester_pays]
      // Instantiate a Google Cloud Storage client
      Storage storage = StorageOptions.getDefaultInstance().getService();
  
      // The name of the existing bucket to enable requester-paying for, e.g. "my-bucket"
      // String bucketName = "my-bucket"
      BucketInfo bucketInfo = BucketInfo.newBuilder(bucketName).setRequesterPays(true).build();
  
      // Update the bucket, throws StorageException on failure
      Bucket bucket = storage.update(bucketInfo);
  
      System.out.println("Requester pay status for " + bucketName + ": " + bucket.requesterPays());
      // [END enable_requester_pays]
      return bucket;
    }
docs: Example of enabling Requester pays on a bucket.