Repository: googleapis/java-storage
Pull request #3109 (2025-05-19 19:58:07)

chore: samples overhaul
* Centralize environment variables resolution in new Env utility class
* Leverage StorageITRunner and associated fixtures
* Condense PubSubNotification test classes into one class that can all share a topic
* Replace usages of the word file with blob (GCS doesn't have files, and our library always presents Blob as its name for a gcs object)
* Use TemporaryBucket for tests which depend on specific bucket state.
  1. Avoids contention between tests trying to change bucket state
  2. Avoids the "too many bucket modifications" error from gcs due to bucket mutations
  3. Makes it possible, for running tests in parallel in the future
* Update samples to apply try-with-resource to TransferManager and Storage instances
* Avoid using syntax classes in tests (use storage.x(blob) instead of blob.x())
* Add ITCleanupOldBucketsTest


snippet-bot[bot]: <!-- probot comment [11299897]-->
Here is the summary of changes.
<details>
  <summary>You are about to add 4 region tags.</summary>

  - [samples/snippets/src/main/java/com/example/storage/object/AddBlobOwner.java:19](https://github.com/googleapis/java-storage/blob/e313ed6677f3d1d87fb19bb844ede0305ec47041/samples/snippets/src/main/java/com/example/storage/object/AddBlobOwner.java#L19), tag `storage_add_file_owner`
- [samples/snippets/src/main/java/com/example/storage/object/PrintBlobAcl.java:19](https://github.com/googleapis/java-storage/blob/e313ed6677f3d1d87fb19bb844ede0305ec47041/samples/snippets/src/main/java/com/example/storage/object/PrintBlobAcl.java#L19), tag `storage_print_file_acl`
- [samples/snippets/src/main/java/com/example/storage/object/PrintBlobAclForUser.java:19](https://github.com/googleapis/java-storage/blob/e313ed6677f3d1d87fb19bb844ede0305ec47041/samples/snippets/src/main/java/com/example/storage/object/PrintBlobAclForUser.java#L19), tag `storage_print_file_acl_for_user`
- [samples/snippets/src/main/java/com/example/storage/object/RemoveBlobOwner.java:19](https://github.com/googleapis/java-storage/blob/e313ed6677f3d1d87fb19bb844ede0305ec47041/samples/snippets/src/main/java/com/example/storage/object/RemoveBlobOwner.java#L19), tag `storage_remove_file_owner`

</details>

<details>
  <summary>You are about to delete 4 region tags.
</summary>

  - [samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java:19](https://github.com/googleapis/java-storage/blob/b1628dddb5ba10192974487f2ee17e19a8dc40e6/samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java#L19), tag `storage_add_file_owner`
- [samples/snippets/src/main/java/com/example/storage/object/PrintFileAcl.java:19](https://github.com/googleapis/java-storage/blob/b1628dddb5ba10192974487f2ee17e19a8dc40e6/samples/snippets/src/main/java/com/example/storage/object/PrintFileAcl.java#L19), tag `storage_print_file_acl`
- [samples/snippets/src/main/java/com/example/storage/object/PrintFileAclForUser.java:19](https://github.com/googleapis/java-storage/blob/b1628dddb5ba10192974487f2ee17e19a8dc40e6/samples/snippets/src/main/java/com/example/storage/object/PrintFileAclForUser.java#L19), tag `storage_print_file_acl_for_user`
- [samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java:19](https://github.com/googleapis/java-storage/blob/b1628dddb5ba10192974487f2ee17e19a8dc40e6/samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java#L19), tag `storage_remove_file_owner`

</details>

---
This comment is generated by [snippet-bot](https://github.com/apps/snippet-bot).
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add `snippet-bot:force-run` label or use the checkbox below:
- [ ] Refresh this comment

generated-files-bot[bot]: <!-- probot comment [12634855]-->
*Warning*: This pull request is touching the following templated files:

* samples/install-without-bom/pom.xml
* samples/snapshot/pom.xml
* samples/snippets/pom.xml

Patch:
diff --git a/README.md b/README.md
index ce251217..2fe6cd50 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
     <dependency>
       <groupId>com.google.cloud</groupId>
       <artifactId>libraries-bom</artifactId>
-      <version>26.60.0</version>
+      <version>26.61.0</version>
       <type>pom</type>
       <scope>import</scope>
     </dependency>
@@ -59,7 +59,7 @@ If you are using Maven without the BOM, add this to your dependencies:
 If you are using Gradle 5.x or later, add this to your dependencies:
 
 ```Groovy
-implementation platform('com.google.cloud:libraries-bom:26.60.0')
+implementation platform('com.google.cloud:libraries-bom:26.61.0')
 
 implementation 'com.google.cloud:google-cloud-storage'
 ```
diff --git a/generation_config.yaml b/generation_config.yaml
index 33a17fbd..e488357e 100644
--- a/generation_config.yaml
+++ b/generation_config.yaml
@@ -1,6 +1,6 @@
 gapic_generator_version: 2.58.0
-googleapis_commitish: 488c8cc0d41aca4b4f33748ab6166129edcfd836
-libraries_bom_version: 26.60.0
+googleapis_commitish: 361c4941ccff4b02f608a0c1af63dcb65a888358
+libraries_bom_version: 26.61.0
 libraries:
   - api_shortname: storage
     name_pretty: Cloud Storage
diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml
index 66fe1d90..c4126c7f 100644
--- a/google-cloud-storage/pom.xml
+++ b/google-cloud-storage/pom.xml
@@ -167,7 +167,7 @@
     <dependency>
       <groupId>com.google.cloud.opentelemetry</groupId>
       <artifactId>exporter-trace</artifactId>
-      <version>0.34.0</version>
+      <version>0.35.0</version>
       <scope>test</scope>
     </dependency>
 
@@ -487,7 +487,7 @@
           <plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>exec-maven-plugin</artifactId>
-            <version>3.5.0</version>
+            <version>3.5.1</version>
             <executions>
               <execution>
                 <goals>
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java
index db2eba83..7d25cde1 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java
@@ -35,6 +35,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.ObjectInputStream;
 import java.io.Serializable;
+import java.math.BigInteger;
 import java.security.Key;
 import java.time.Duration;
 import java.time.OffsetDateTime;
@@ -502,7 +503,7 @@ public class Bucket extends BucketInfo {
     }
 
     @Override
-    Builder setProject(String project) {
+    Builder setProject(BigInteger project) {
       infoBuilder.setProject(project);
       return this;
     }
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java
index c9ade023..3899c703 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java
@@ -45,6 +45,7 @@ import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
+import java.math.BigInteger;
 import java.time.Duration;
 import java.time.OffsetDateTime;
 import java.util.ArrayList;
@@ -80,7 +81,7 @@ public class BucketInfo implements Serializable {
 
   private static final long serialVersionUID = 4793572058456298945L;
   private final String generatedId;
-  private final String project;
+  private final BigInteger project;
   private final String name;
   private final Acl.Entity owner;
   private final String selfLink;
@@ -1657,7 +1658,7 @@ public class BucketInfo implements Serializable {
   public abstract static class Builder {
     Builder() {}
 
-    abstract Builder setProject(String project);
+    abstract Builder setProject(BigInteger project);
 
     /** Sets the bucket's name. */
     public abstract Builder setName(String name);
@@ -1923,7 +1924,7 @@ public class BucketInfo implements Serializable {
   static final class BuilderImpl extends Builder {
 
     private String generatedId;
-    private String project;
+    private BigInteger project;
     private String name;
     private Acl.Entity owner;
     private String selfLink;
@@ -2007,7 +2008,10 @@ public class BucketInfo implements Serializable {
     }
 
     @Override
-    Builder setProject(String project) {
+    Builder setProject(BigInteger project) {
+      if (!Objects.equals(this.project, project)) {
+        modifiedFields.add(BucketField.PROJECT);
+      }
       this.project = project;
       return this;
     }
@@ -2637,7 +2641,8 @@ public class BucketInfo implements Serializable {
     modifiedFields = builder.modifiedFields.build();
   }
 
-  String getProject() {
+  /** The project number of the project the bucket belongs to */
+  public BigInteger getProject() {
     return project;
   }
 
@@ -2993,6 +2998,7 @@ public class BucketInfo implements Serializable {
   public int hashCode() {
     return Objects.hash(
         generatedId,
+        project,
         name,
         owner,
         selfLink,
@@ -3022,6 +3028,7 @@ public class BucketInfo implements Serializable {
         locationType,
         objectRetention,
         softDeletePolicy,
+        customPlacementConfig,
         hierarchicalNamespace,
         logging);
   }
@@ -3036,6 +3043,7 @@ public class BucketInfo implements Serializable {
     }
     BucketInfo that = (BucketInfo) o;
     return Objects.equals(generatedId, that.generatedId)
+        && Objects.equals(project, that.project)
         && Objects.equals(name, that.name)
         && Objects.equals(owner, that.owner)
         && Objects.equals(selfLink, that.selfLink)
@@ -3063,6 +3071,7 @@ public class BucketInfo implements Serializable {
         && Objects.equals(iamConfiguration, that.iamConfiguration)
         && Objects.equals(autoclass, that.autoclass)
         && Objects.equals(locationType, that.locationType)
+        && Objects.equals(customPlacementConfig, that.customPlacementConfig)
         && Objects.equals(objectRetention, that.objectRetention)
         && Objects.equals(softDeletePolicy, that.softDeletePolicy)
         && Objects.equals(hierarchicalNamespace, that.hierarchicalNamespace)
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcConversions.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcConversions.java
index 39d5986d..4d9d5e31 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcConversions.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcConversions.java
@@ -20,7 +20,7 @@ import static com.google.cloud.storage.Storage.BucketField.SOFT_DELETE_POLICY;
 import static com.google.cloud.storage.Utils.bucketNameCodec;
 import static com.google.cloud.storage.Utils.ifNonNull;
 import static com.google.cloud.storage.Utils.lift;
-import static com.google.cloud.storage.Utils.projectNameCodec;
+import static com.google.cloud.storage.Utils.projectNumberResourceCodec;
 
 import com.google.api.pathtemplate.PathTemplate;
 import com.google.cloud.Binding;
@@ -204,7 +204,9 @@ final class GrpcConversions {
 
   private BucketInfo bucketInfoDecode(Bucket from) {
     BucketInfo.Builder to = new BucketInfo.BuilderImpl(bucketNameCodec.decode(from.getName()));
-    to.setProject(projectNameCodec.decode(from.getProject()));
+    if (!from.getProject().isEmpty()) {
+      to.setProject(projectNumberResourceCodec.decode(from.getProject()));
+    }
     to.setGeneratedId(from.getBucketId());
     maybeDecodeRetentionPolicy(from, to);
     ifNonNull(from.getLocation(), to::setLocation);
@@ -304,7 +306,7 @@ final class GrpcConversions {
   private Bucket bucketInfoEncode(BucketInfo from) {
     Bucket.Builder to = Bucket.newBuilder();
     to.setName(bucketNameCodec.encode(from.getName()));
-    ifNonNull(from.getProject(), projectNameCodec::encode, to::setProject);
+    ifNonNull(from.getProject(), projectNumberResourceCodec::encode, to::setProject);
     ifNonNull(from.getGeneratedId(), to::setBucketId);
     maybeEncodeRetentionPolicy(from, to);
     ifNonNull(from.getLocation(), to::setLocation);
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java
index 8a838604..50b3596c 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java
@@ -26,6 +26,7 @@ import static com.google.cloud.storage.StorageV2ProtoUtils.bucketAclEntityOrAltE
 import static com.google.cloud.storage.StorageV2ProtoUtils.objectAclEntityOrAltEq;
 import static com.google.cloud.storage.Utils.bucketNameCodec;
 import static com.google.cloud.storage.Utils.ifNonNull;
+import static com.google.cloud.storage.Utils.projectNameCodec;
 import static com.google.common.base.MoreObjects.firstNonNull;
 import static java.util.Objects.requireNonNull;
 
@@ -216,15 +217,15 @@ final class GrpcStorageImpl extends BaseService<StorageOptions>
     Opts<BucketTargetOpt> opts = Opts.unwrap(options).resolveFrom(bucketInfo).prepend(defaultOpts);
     GrpcCallContext grpcCallContext =
         opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault());
-    if (bucketInfo.getProject() == null || bucketInfo.getProject().trim().isEmpty()) {
-      bucketInfo = bucketInfo.toBuilder().setProject(getOptions().getProjectId()).build();
-    }
     com.google.storage.v2.Bucket bucket = codecs.bucketInfo().encode(bucketInfo);
     CreateBucketRequest.Builder builder =
         CreateBucketRequest.newBuilder()
             .setBucket(bucket)
             .setBucketId(bucketInfo.getName())
             .setParent("projects/_");
+    if (bucketInfo.getProject() == null) {
+      builder.getBucketBuilder().setProject(projectNameCodec.encode(getOptions().getProjectId()));
+    }
     CreateBucketRequest req = opts.createBucketsRequest().apply(builder).build();
     GrpcCallContext merge = Utils.merge(grpcCallContext, Retrying.newCallContext());
     return retrier.run(
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/JsonConversions.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/JsonConversions.java
index 12562cb0..7f9da1f5 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/JsonConversions.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/JsonConversions.java
@@ -22,7 +22,6 @@ import static com.google.cloud.storage.Utils.durationSecondsCodec;
 import static com.google.cloud.storage.Utils.ifNonNull;
 import static com.google.cloud.storage.Utils.lift;
 import static com.google.cloud.storage.Utils.nullableDateTimeCodec;
-import static com.google.cloud.storage.Utils.projectNameCodec;
 import static com.google.common.base.MoreObjects.firstNonNull;
 
 import com.google.api.client.util.Data;
@@ -90,10 +89,6 @@ import java.util.stream.Collectors;
 @InternalApi
 final class JsonConversions {
   static final JsonConversions INSTANCE = new JsonConversions();
-  // gRPC has a Bucket.project property that apiary doesn't have yet.
-  // when converting from gRPC to apiary or vice-versa we want to preserve this property. Until
-  // such a time as the apiary model has a project field, we manually apply it with this name.
-  private static final String PROJECT_ID_FIELD_NAME = "x_project";
 
   private final Codec<Entity, String> entityCodec =
       Codec.of(this::entityEncode, this::entityDecode);
@@ -394,7 +389,7 @@ final class JsonConversions {
 
   private Bucket bucketInfoEncode(BucketInfo from) {
     Bucket to = new Bucket();
-    ifNonNull(from.getProject(), projectNameCodec::encode, p -> to.set(PROJECT_ID_FIELD_NAME, p));
+    ifNonNull(from.getProject(), to::setProjectNumber);
     ifNonNull(from.getAcl(), toListOf(bucketAcl()::encode), to::setAcl);
     ifNonNull(from.getCors(), toListOf(cors()::encode), to::setCors);
     ifNonNull(from.getCreateTimeOffsetDateTime(), dateTimeCodec::encode, to::setTimeCreated);
@@ -477,10 +472,7 @@ final class JsonConversions {
   @SuppressWarnings("deprecation")
   private BucketInfo bucketInfoDecode(com.google.api.services.storage.model.Bucket from) {
     BucketInfo.Builder to = new BucketInfo.BuilderImpl(from.getName());
-    ifNonNull(
-        from.get(PROJECT_ID_FIELD_NAME),
-        lift(String.class::cast).andThen(projectNameCodec::decode),
-        to::setProject);
+    ifNonNull(from.getProjectNumber(), to::setProject);
     ifNonNull(from.getAcl(), toListOf(bucketAcl()::decode), to::setAcl);
     ifNonNull(from.getCors(), toListOf(cors()::decode), to::setCors);
     ifNonNull(from.getDefaultObjectAcl(), toListOf(objectAcl()::decode), to::setDefaultAcl);
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java
index 301792e1..d2c38763 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java
@@ -62,6 +62,7 @@ import java.io.InputStream;
 import java.io.ObjectInputStream;
 import java.io.OutputStream;
 import java.io.Serializable;
+import java.math.BigInteger;
 import java.net.URL;
 import java.net.URLConnection;
 import java.nio.file.Path;
@@ -190,7 +191,10 @@ public interface Storage extends Service<StorageOptions>, AutoCloseable {
     SOFT_DELETE_POLICY(
         "softDeletePolicy",
         "soft_delete_policy",
-        com.google.api.services.storage.model.Bucket.SoftDeletePolicy.class);
+        com.google.api.services.storage.model.Bucket.SoftDeletePolicy.class),
+
+    @TransportCompatibility({Transport.HTTP, Transport.GRPC})
+    PROJECT("projectNumber", "project", BigInteger.class);
 
     static final List<BucketField> REQUIRED_FIELDS = ImmutableList.of(NAME);
     private static final Map<String, BucketField> JSON_FIELD_NAME_INDEX;
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Utils.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Utils.java
index 0e436bd0..4bc73dac 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Utils.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Utils.java
@@ -25,6 +25,7 @@ import com.google.api.gax.rpc.ApiCallContext;
 import com.google.cloud.storage.Conversions.Codec;
 import com.google.cloud.storage.UnifiedOpts.NamedField;
 import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.MapDifference;
@@ -33,6 +34,7 @@ import com.google.common.io.BaseEncoding;
 import com.google.common.primitives.Ints;
 import com.google.storage.v2.BucketName;
 import com.google.storage.v2.ProjectName;
+import java.math.BigInteger;
 import java.time.Duration;
 import java.time.Instant;
 import java.time.OffsetDateTime;
@@ -174,6 +176,27 @@ final class Utils {
             }
           });
 
+  /**
+   * Define a Codec which encapsulates the logic necessary to handle encoding and decoding project
+   * numbers.
+   */
+  static final Codec<@NonNull BigInteger, @NonNull String> projectNumberResourceCodec =
+      Codec.of(
+          projectNumber -> {
+            requireNonNull(projectNumber, "projectNumber must be non null");
+            return ProjectName.format(projectNumber.toString());
+          },
+          projectNumberResource -> {
+            requireNonNull(projectNumberResource, "projectNumberResource must be non null");
+            Preconditions.checkArgument(
+                ProjectName.isParsableFrom(projectNumberResource),
+                "projectNumberResource '%s' is not parsable as a %s",
+                projectNumberResource,
+                ProjectName.class.getName());
+            ProjectName parse = ProjectName.parse(projectNumberResource);
+            return new BigInteger(parse.getProject());
+          });
+
   static final Codec<Integer, String> crc32cCodec =
       Codec.of(Utils::crc32cEncode, Utils::crc32cDecode);
 
diff --git a/pom.xml b/pom.xml
index 6b130f6e..dadb2c10 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,7 +87,7 @@
       <dependency>
         <groupId>com.google.apis</groupId>
         <artifactId>google-api-services-storage</artifactId>
-        <version>v1-rev20250509-2.0.0</version>
+        <version>v1-rev20250521-2.0.0</version>
       </dependency>
       <dependency>
         <groupId>com.google.cloud</groupId>
diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml
index caa32daa..5c845a05 100644
--- a/samples/install-without-bom/pom.xml
+++ b/samples/install-without-bom/pom.xml
@@ -69,6 +69,12 @@
       <version>1.139.4</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>com.google.cloud</groupId>
+      <artifactId>google-cloud-kms</artifactId>
+      <version>2.66.0</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>com.google.cloud</groupId>
       <artifactId>google-cloud-storage</artifactId>
@@ -76,10 +82,23 @@
       <classifier>tests</classifier>
       <scope>test</scope>
     </dependency>
+    <!-- tests jars don't have transitive dependencies automatically resolved -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jul-to-slf4j</artifactId>
+      <version>2.0.17</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+      <version>1.3.15</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>com.google.cloud.opentelemetry</groupId>
       <artifactId>exporter-trace</artifactId>
-      <version>0.34.0</version>
+      <version>0.35.0</version>
     </dependency>
     <dependency>
       <groupId>com.google.cloud.opentelemetry</groupId>
diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index 0727335a..a17b3c2c 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -61,6 +61,12 @@
       <version>1.139.4</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>com.google.cloud</groupId>
+      <artifactId>google-cloud-kms</artifactId>
+      <version>2.66.0</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>com.google.cloud</groupId>
       <artifactId>google-cloud-storage</artifactId>
@@ -68,10 +74,23 @@
       <classifier>tests</classifier>
       <scope>test</scope>
     </dependency>
+    <!-- tests jars don't have transitive dependencies automatically resolved -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jul-to-slf4j</artifactId>
+      <version>2.0.17</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+      <version>1.3.15</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>com.google.cloud.opentelemetry</groupId>
       <artifactId>exporter-trace</artifactId>
-      <version>0.34.0</version>
+      <version>0.35.0</version>
     </dependency>
     <dependency>
       <groupId>com.google.cloud.opentelemetry</groupId>
diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml
index 61980692..36cb3d3e 100644
--- a/samples/snippets/pom.xml
+++ b/samples/snippets/pom.xml
@@ -31,7 +31,7 @@
       <dependency>
         <groupId>com.google.cloud</groupId>
         <artifactId>libraries-bom</artifactId>
-        <version>26.60.0</version>
+        <version>26.61.0</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
@@ -79,10 +79,16 @@
       <version>1.139.4</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>com.google.cloud</groupId>
+      <artifactId>google-cloud-kms</artifactId>
+      <version>2.66.0</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>com.google.cloud.opentelemetry</groupId>
       <artifactId>exporter-trace</artifactId>
-      <version>0.34.0</version>
+      <version>0.35.0</version>
     </dependency>
     <dependency>
       <groupId>com.google.cloud.opentelemetry</groupId>
@@ -97,6 +103,19 @@
       <classifier>tests</classifier>
       <scope>test</scope>
     </dependency>
+    <!-- tests jars don't have transitive dependencies automatically resolved -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jul-to-slf4j</artifactId>
+      <version>2.0.17</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+      <version>1.3.15</version>
+      <scope>test</scope>
+    </dependency>
     <!-- [START storage_install_with_bom] -->
   </dependencies>
   <!-- [END storage_install_with_bom] -->
diff --git a/samples/snippets/src/main/java/com/example/storage/QuickstartStorageControlSample.java b/samples/snippets/src/main/java/com/example/storage/QuickstartStorageControlSample.java
index 28ad20d1..51458e8c 100644
--- a/samples/snippets/src/main/java/com/example/storage/QuickstartStorageControlSample.java
+++ b/samples/snippets/src/main/java/com/example/storage/QuickstartStorageControlSample.java
@@ -34,7 +34,7 @@ public class QuickstartStorageControlSample {
               .setName(StorageLayoutName.format("_", bucketName))
               .build();
       StorageLayout response = storageControlClient.getStorageLayout(request);
-      System.out.printf("Performed getStorageLayout request for %s", response.getName());
+      System.out.printf("Performed getStorageLayout request for %s%n", response.getName());
     }
   }
 }
diff --git a/samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java b/samples/snippets/src/main/java/com/example/storage/object/AddBlobOwner.java
similarity index 94%
rename from samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java
rename to samples/snippets/src/main/java/com/example/storage/object/AddBlobOwner.java
index 394bc15b..75c4c88d 100644
--- a/samples/snippets/src/main/java/com/example/storage/object/AddFileOwner.java
+++ b/samples/snippets/src/main/java/com/example/storage/object/AddBlobOwner.java
@@ -26,9 +26,9 @@ import com.google.cloud.storage.BlobId;
 import com.google.cloud.storage.Storage;
 import com.google.cloud.storage.StorageOptions;
 
-public class AddFileOwner {
+public class AddBlobOwner {
 
-  public static void addFileOwner(
+  public static void addBlobOwner(
       String projectId, String bucketName, String userEmail, String blobName) {
     // The ID of your GCP project
     // String projectId = "your-project-id";
@@ -50,7 +50,7 @@ public class AddFileOwner {
     System.out.println(
         "Added user "
             + userEmail
-            + " as an owner on file "
+            + " as an owner on blob "
             + blobName
             + " in bucket "
             + bucketName);
diff --git a/samples/snippets/src/main/java/com/example/storage/object/BatchSetObjectMetadata.java b/samples/snippets/src/main/java/com/example/storage/object/BatchSetObjectMetadata.java
index d7db7359..90c6a136 100644
--- a/samples/snippets/src/main/java/com/example/storage/object/BatchSetObjectMetadata.java
+++ b/samples/snippets/src/main/java/com/example/storage/object/BatchSetObjectMetadata.java
@@ -19,15 +19,21 @@ package com.example.storage.object;
 // [START storage_batch_request]
 import com.google.api.gax.paging.Page;
 import com.google.cloud.storage.Blob;
+import com.google.cloud.storage.BlobInfo;
 import com.google.cloud.storage.Storage;
 import com.google.cloud.storage.StorageBatch;
+import com.google.cloud.storage.StorageBatchResult;
+import com.google.cloud.storage.StorageException;
 import com.google.cloud.storage.StorageOptions;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
 
 public class BatchSetObjectMetadata {
   public static void batchSetObjectMetadata(
-      String projectId, String bucketName, String directoryPrefix) {
+      String projectId, String bucketName, String pathPrefix) {
     // The ID of your GCP project
     // String projectId = "your-project-id";
 
@@ -36,7 +42,7 @@ public class BatchSetObjectMetadata {
 
     // The directory prefix. All objects in the bucket with this prefix will have their metadata
     // updated
-    // String directoryPrefix = "yourDirectory/";
+    // String pathPrefix = "yourPath/";
 
     Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService();
     Map<String, String> newMetadata = new HashMap<>();
@@ -44,24 +50,48 @@ public class BatchSetObjectMetadata {
     Page<Blob> blobs =
         storage.list(
             bucketName,
-            Storage.BlobListOption.prefix(directoryPrefix),
-            Storage.BlobListOption.currentDirectory());
+            Storage.BlobListOption.prefix(pathPrefix),
+            Storage.BlobListOption.delimiter("/"));
     StorageBatch batchRequest = storage.batch();
 
     // Add all blobs with the given prefix to the batch request
-    for (Blob blob : blobs.iterateAll()) {
-      batchRequest.update(blob.toBuilder().setMetadata(newMetadata).build());
-    }
+    List<StorageBatchResult<Blob>> batchResults =
+        blobs
+            .streamAll()
+            .map(blob -> batchRequest.update(blob.toBuilder().setMetadata(newMetadata).build()))
+            .collect(Collectors.toList());
 
     // Execute the batch request
     batchRequest.submit();
+    List<StorageException> failures =
+        batchResults.stream()
+            .map(
+                r -> {
+                  try {
+                    BlobInfo blob = r.get();
+                    return null;
+                  } catch (StorageException e) {
+                    return e;
+                  }
+                })
+            .filter(Objects::nonNull)
+            .collect(Collectors.toList());
 
     System.out.println(
-        "All blobs in bucket "
+        (batchResults.size() - failures.size())
+            + " blobs in bucket "
             + bucketName
             + " with prefix '"
-            + directoryPrefix
-            + "' had their metadata updated.");
+            + pathPrefix
+            + "' had their metadata updated successfully.");
+
+    if (!failures.isEmpty()) {
+      System.out.println("While processing, there were " + failures.size() + " failures");
+
+      for (StorageException failure : failures) {
+        failure.printStackTrace(System.out);
+      }
+    }
   }
 }
 // [END storage_batch_request]
diff --git a/samples/snippets/src/main/java/com/example/storage/object/DownloadByteRange.java b/samples/snippets/src/main/java/com/example/storage/object/DownloadByteRange.java
index b7327a72..e64bbb7c 100644
--- a/samples/snippets/src/main/java/com/example/storage/object/DownloadByteRange.java
+++ b/samples/snippets/src/main/java/com/example/storage/object/DownloadByteRange.java
@@ -66,7 +66,7 @@ public class DownloadByteRange {
       ByteStreams.copy(from, to);
 
       System.out.printf(
-          "%s downloaded to %s from byte %d to byte %d",
+          "%s downloaded to %s from byte %d to byte %d%n",
           blobId.toGsUtilUri(), destFileName, startByte, endBytes);
     }
   }
diff --git a/samples/snippets/src/main/java/com/example/storage/object/DownloadObject.java b/samples/snippets/src/main/java/com/example/storage/object/DownloadObject.java
index 8f0f848e..d7982f6c 100644
--- a/samples/snippets/src/main/java/com/example/storage/object/DownloadObject.java
+++ b/samples/snippets/src/main/java/com/example/storage/object/DownloadObject.java
@@ -18,7 +18,6 @@ package com.example.storage.object;
 
 // [START storage_download_file]
 
-import com.google.cloud.storage.Blob;
 import com.google.cloud.storage.BlobId;
 import com.google.cloud.storage.Storage;
 import com.google.cloud.storage.StorageOptions;
@@ -26,7 +25,8 @@ import java.nio.file.Paths;
 
 public class DownloadObject {
   public static void downloadObject(
-      String projectId, String bucketName, String objectName, String destFilePath) {
+      String projectId, String bucketName, String objectName, String destFilePath)
+      throws Exception {
     // The ID of your GCP project
     // String projectId = "your-project-id";
 
@@ -39,18 +39,19 @@ public class DownloadObject {
     // The path to which the file should be downloaded
     // String destFilePath = "/local/path/to/file.txt";
 
-    Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService();
+    StorageOptions storageOptions = StorageOptions.newBuilder().setProjectId(projectId).build();
+    try (Storage storage = storageOptions.getService()) {
 
-    Blob blob = storage.get(BlobId.of(bucketName, objectName));
-    blob.downloadTo(Paths.get(destFilePath));
+      storage.downloadTo(BlobId.of(bucketName, objectName), Paths.get(destFilePath));
 
-    System.out.println(
-        "Downloaded object "
-            + objectName
-            + " from bucket name "
-            + bucketName
-            + " to "
-            + destFilePath);
+      System.out.println(
+          "Downloaded object "
+              + objectName
+              + " from bucket name "
+              + bucketName
+              + " to "
+              + destFilePath);
+    }
   }
 }
 // [END storage_download_file]
diff --git a/samples/snippets/src/main/java/com/example/storage/object/DownloadPublicObject.java b/samples/snippets/src/main/java/com/example/storage/object/DownloadPublicObject.java
index b8072893..feb966b1 100644
--- a/samples/snippets/src/main/java/com/example/storage/object/DownloadPublicObject.java
+++ b/samples/snippets/src/main/java/com/example/storage/object/DownloadPublicObject.java
@@ -18,7 +18,6 @@ package com.example.storage.object;
 
 // [START storage_download_public_file]
 
-import com.google.cloud.storage.Blob;
 import com.google.cloud.storage.BlobId;
 import com.google.cloud.storage.Storage;
 import com.google.cloud.storage.StorageOptions;
@@ -39,8 +38,7 @@ public class DownloadPublicObject {
     // Instantiate an anonymous Google Cloud Storage client, which can only access public files
     Storage storage = StorageOptions.getUnauthenticatedInstance().getService();
 
-    Blob blob = storage.get(BlobId.of(bucketName, publicObjectName));
-    blob.downloadTo(destFilePath);
+    storage.downloadTo(BlobId.of(bucketName, publicObjectName), destFilePath);
 
     System.out.println(
         "Downloaded public object "
diff --git a/samples/snippets/src/main/java/com/example/storage/object/PrintFileAcl.java b/samples/snippets/src/main/java/com/example/storage/object/PrintBlobAcl.java
similarity index 95%
rename from samples/snippets/src/main/java/com/example/storage/object/PrintFileAcl.java
rename to samples/snippets/src/main/java/com/example/storage/object/PrintBlobAcl.java
index 5fbcad0c..34089a56 100644
--- a/samples/snippets/src/main/java/com/example/storage/object/PrintFileAcl.java
+++ b/samples/snippets/src/main/java/com/example/storage/object/PrintBlobAcl.java
@@ -25,9 +25,9 @@ import com.google.cloud.storage.Storage;
 import com.google.cloud.storage.StorageOptions;
 import java.util.List;
 
-public class PrintFileAcl {
+public class PrintBlobAcl {
 
-  public static void printFileAcl(String bucketName, String blobName) {
+  public static void printBlobAcl(String bucketName, String blobName) {
 
     // The ID to give your GCS bucket
     // String bucketName = "your-unique-bucket-name";
diff --git a/samples/snippets/src/main/java/com/example/storage/object/PrintFileAclForUser.java b/samples/snippets/src/main/java/com/example/storage/object/PrintBlobAclForUser.java
similarity index 68%
rename from samples/snippets/src/main/java/com/example/storage/object/PrintFileAclForUser.java
rename to samples/snippets/src/main/java/com/example/storage/object/PrintBlobAclForUser.java
index d150cfa9..60d7bc22 100644
--- a/samples/snippets/src/main/java/com/example/storage/object/PrintFileAclForUser.java
+++ b/samples/snippets/src/main/java/com/example/storage/object/PrintBlobAclForUser.java
@@ -25,9 +25,10 @@ import com.google.cloud.storage.BlobId;
 import com.google.cloud.storage.Storage;
 import com.google.cloud.storage.StorageOptions;
 
-public class PrintFileAclForUser {
+public class PrintBlobAclForUser {
 
-  public static void printFileAclForUser(String bucketName, String blobName, String userEmail) {
+  public static void printBlobAclForUser(String bucketName, String blobName, String userEmail)
+      throws Exception {
 
     // The ID to give your GCS bucket
     // String bucketName = "your-unique-bucket-name";
@@ -38,14 +39,15 @@ public class PrintFileAclForUser {
     // The email of the user whose acl is being retrieved.
     // String userEmail = "someuser@domain.com"
 
-    Storage storage = StorageOptions.newBuilder().build().getService();
-    Blob blob = storage.get(BlobId.of(bucketName, blobName));
-    Acl blobAcl = blob.getAcl(new User(userEmail));
-    if (blobAcl != null) {
-      String userRole = blobAcl.getRole().name();
-      System.out.println("User " + userEmail + " has role " + userRole);
-    } else {
-      System.out.println("User " + userEmail + " not found");
+    try (Storage storage = StorageOptions.newBuilder().build().getService()) {
+      Blob blob = storage.get(BlobId.of(bucketName, blobName));
+      Acl blobAcl = blob.getAcl(new User(userEmail));
+      if (blobAcl != null) {
+        String userRole = blobAcl.getRole().name();
+        System.out.println("User " + userEmail + " has role " + userRole);
+      } else {
+        System.out.println("User " + userEmail + " not found");
+      }
     }
   }
 }
diff --git a/samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java b/samples/snippets/src/main/java/com/example/storage/object/RemoveBlobOwner.java
similarity index 96%
rename from samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java
rename to samples/snippets/src/main/java/com/example/storage/object/RemoveBlobOwner.java
index bb6c35a9..ecbb0e41 100644
--- a/samples/snippets/src/main/java/com/example/storage/object/RemoveFileOwner.java
+++ b/samples/snippets/src/main/java/com/example/storage/object/RemoveBlobOwner.java
@@ -24,9 +24,9 @@ import com.google.cloud.storage.BlobId;
 import com.google.cloud.storage.Storage;
 import com.google.cloud.storage.StorageOptions;
 
-public class RemoveFileOwner {
+public class RemoveBlobOwner {
 
-  public static void removeFileOwner(
+  public static void removeBlobOwner(
       String projectId, String bucketName, String userEmail, String blobName) {
     // The ID of your GCP project
     // String projectId = "your-project-id";
diff --git a/samples/snippets/src/main/java/com/example/storage/object/SetObjectMetadata.java b/samples/snippets/src/main/java/com/example/storage/object/SetObjectMetadata.java
index 5fde73f3..ae05011e 100644
--- a/samples/snippets/src/main/java/com/example/storage/object/SetObjectMetadata.java
+++ b/samples/snippets/src/main/java/com/example/storage/object/SetObjectMetadata.java
@@ -20,6 +20,7 @@ package com.example.storage.object;
 
 import com.google.cloud.storage.Blob;
 import com.google.cloud.storage.BlobId;
+import com.google.cloud.storage.BlobInfo;
 import com.google.cloud.storage.Storage;
 import com.google.cloud.storage.StorageOptions;
 import java.util.HashMap;
@@ -53,7 +54,8 @@ public class SetObjectMetadata {
 
     // Does an upsert operation, if the key already exists it's replaced by the new value, otherwise
     // it's added.
-    blob.toBuilder().setMetadata(newMetadata).build().update(precondition);
+    BlobInfo pendingUpdate = blob.toBuilder().setMetadata(newMetadata).build();
+    storage.update(pendingUpdate, precondition);
 
     System.out.println(
         "Updated custom metadata for object " + objectName + " in bucket " + bucketName);
diff --git a/samples/snippets/src/main/java/com/example/storage/transfermanager/DownloadMany.java b/samples/snippets/src/main/java/com/example/storage/transfermanager/DownloadMany.java
index aae4d805..a79e18cd 100644
--- a/samples/snippets/src/main/java/com/example/storage/transfermanager/DownloadMany.java
+++ b/samples/snippets/src/main/java/com/example/storage/transfermanager/DownloadMany.java
@@ -28,24 +28,26 @@ import java.util.List;
 class DownloadMany {
 
   public static void downloadManyBlobs(
-      String bucketName, List<BlobInfo> blobs, Path destinationDirectory) {
+      String bucketName, List<BlobInfo> blobs, Path destinationDirectory) throws Exception {
 
-    TransferManager transferManager = TransferManagerConfig.newBuilder().build().getService();
-    ParallelDownloadConfig parallelDownloadConfig =
-        ParallelDownloadConfig.newBuilder()
-            .setBucketName(bucketName)
-            .setDownloadDirectory(destinationDirectory)
-            .build();
+    try (TransferManager transferManager =
+        TransferManagerConfig.newBuilder().build().getService()) {
+      ParallelDownloadConfig parallelDownloadConfig =
+          ParallelDownloadConfig.newBuilder()
+              .setBucketName(bucketName)
+              .setDownloadDirectory(destinationDirectory)
+              .build();
 
-    List<DownloadResult> results =
-        transferManager.downloadBlobs(blobs, parallelDownloadConfig).getDownloadResults();
+      List<DownloadResult> results =
+          transferManager.downloadBlobs(blobs, parallelDownloadConfig).getDownloadResults();
 
-    for (DownloadResult result : results) {
-      System.out.println(
-          "Download of "
-              + result.getInput().getName()
-              + " completed with status "
-              + result.getStatus());
+      for (DownloadResult result : results) {
+        System.out.println(
+            "Download of "
+                + result.getInput().getName()
+                + " completed with status "
+                + result.getStatus());
+      }
     }
   }
 }


Test patch:
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/GrpcUtilsTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/GrpcUtilsTest.java
index 06dfcca5..9ca5bcd1 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/GrpcUtilsTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/GrpcUtilsTest.java
@@ -16,8 +16,14 @@
 
 package com.google.cloud.storage;
 
+import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assert.assertThrows;
+
+import com.google.cloud.storage.Conversions.Codec;
 import java.io.IOException;
+import java.math.BigInteger;
 import java.util.Collections;
+import org.checkerframework.checker.nullness.qual.NonNull;
 import org.junit.Test;
 
 public final class GrpcUtilsTest {
@@ -26,4 +32,41 @@ public final class GrpcUtilsTest {
   public void closeAll_noNpeIfNullStream() throws IOException {
     GrpcUtils.closeAll(Collections.singletonList(null));
   }
+
+  @Test
+  public void projectNumberResourceCodec_simple() {
+    Codec<@NonNull BigInteger, @NonNull String> codec = Utils.projectNumberResourceCodec;
+
+    String encode = codec.encode(new BigInteger("34567892123"));
+    assertThat(encode).isEqualTo("projects/34567892123");
+
+    BigInteger decode = codec.decode(encode);
+    assertThat(decode).isEqualTo(new BigInteger("34567892123"));
+  }
+
+  @Test
+  public void projectNumberResourceCodec_decode_illegalArgumentException_whenUnParsable() {
+    String bad = "not-a-projects/123081892932";
+    IllegalArgumentException iae =
+        assertThrows(
+            IllegalArgumentException.class, () -> Utils.projectNumberResourceCodec.decode(bad));
+
+    assertThat(iae).hasMessageThat().contains(bad);
+  }
+
+  @Test
+  public void projectNumberResourceCodec_decode_nonNull() {
+    assertThrows(NullPointerException.class, () -> Utils.projectNumberResourceCodec.decode(null));
+  }
+
+  @Test
+  public void projectNumberResourceCodec_encode_nonNull() {
+    assertThrows(NullPointerException.class, () -> Utils.projectNumberResourceCodec.encode(null));
+  }
+
+  @Test
+  public void projectNumberResourceCodec_decode_notProjectNumber() {
+    String bad = "projects/not-a-number";
+    assertThrows(NumberFormatException.class, () -> Utils.projectNumberResourceCodec.decode(bad));
+  }
 }
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/ITGapicBidiUnbufferedWritableByteChannelTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/ITGapicBidiUnbufferedWritableByteChannelTest.java
index b8de62b0..475ba6b3 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/ITGapicBidiUnbufferedWritableByteChannelTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/ITGapicBidiUnbufferedWritableByteChannelTest.java
@@ -48,11 +48,12 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.function.BiConsumer;
-import java.util.logging.Logger;
 import java.util.stream.Collector;
 import java.util.stream.Collectors;
 import org.checkerframework.checker.nullness.qual.NonNull;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public final class ITGapicBidiUnbufferedWritableByteChannelTest {
 
@@ -830,7 +831,7 @@ public final class ITGapicBidiUnbufferedWritableByteChannelTest {
   }
 
   static class BidiWriteService extends StorageImplBase {
-    private static final Logger LOGGER = Logger.getLogger(BidiWriteService.class.getName());
+    private static final Logger LOGGER = LoggerFactory.getLogger(BidiWriteService.class);
     private final BiConsumer<StreamObserver<BidiWriteObjectResponse>, List<BidiWriteObjectRequest>>
         c;
 
@@ -878,7 +879,7 @@ public final class ITGapicBidiUnbufferedWritableByteChannelTest {
                   .map(l -> l.stream().map(StorageV2ProtoUtils::fmtProto).collect(oneLine))
                   .collect(joining),
               build.stream().map(StorageV2ProtoUtils::fmtProto).collect(oneLine));
-      LOGGER.warning(msg);
+      LOGGER.warn(msg);
     }
 
     @Override
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/ITGapicUnbufferedWritableByteChannelTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/ITGapicUnbufferedWritableByteChannelTest.java
index 2b1e09ba..a31fc0c3 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/ITGapicUnbufferedWritableByteChannelTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/ITGapicUnbufferedWritableByteChannelTest.java
@@ -51,14 +51,15 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.BiConsumer;
-import java.util.logging.Logger;
 import java.util.stream.Collector;
 import java.util.stream.Collectors;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public final class ITGapicUnbufferedWritableByteChannelTest {
   private static final Logger LOGGER =
-      Logger.getLogger(ITGapicUnbufferedWritableByteChannelTest.class.getName());
+      LoggerFactory.getLogger(ITGapicUnbufferedWritableByteChannelTest.class);
 
   private static final Hasher HASHER = Hasher.enabled();
   private static final ChunkSegmenter segmenter =
@@ -202,7 +203,7 @@ public final class ITGapicUnbufferedWritableByteChannelTest {
         c.close();
       } catch (PermissionDeniedException ignore) {
         for (String debugMessage : debugMessages) {
-          LOGGER.warning(debugMessage);
+          LOGGER.warn(debugMessage);
         }
       }
       assertThat(result.get()).isEqualTo(resp5);
@@ -331,7 +332,7 @@ public final class ITGapicUnbufferedWritableByteChannelTest {
   }
 
   static class DirectWriteService extends StorageImplBase {
-    private static final Logger LOGGER = Logger.getLogger(DirectWriteService.class.getName());
+    private static final Logger LOGGER = LoggerFactory.getLogger(DirectWriteService.class);
     private final BiConsumer<StreamObserver<WriteObjectResponse>, List<WriteObjectRequest>> c;
 
     private ImmutableList.Builder<WriteObjectRequest> requests;
@@ -368,7 +369,7 @@ public final class ITGapicUnbufferedWritableByteChannelTest {
                   .map(l -> l.stream().map(StorageV2ProtoUtils::fmtProto).collect(oneLine))
                   .collect(joining),
               build.stream().map(StorageV2ProtoUtils::fmtProto).collect(oneLine));
-      LOGGER.warning(msg);
+      LOGGER.warn(msg);
     }
 
     @Override
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java
index 1729c6ff..1cfd80cd 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/ITRetryConformanceTest.java
@@ -63,7 +63,6 @@ import java.util.Random;
 import java.util.Set;
 import java.util.function.BiPredicate;
 import java.util.function.Predicate;
-import java.util.logging.Logger;
 import java.util.stream.Collectors;
 import org.checkerframework.checker.nullness.qual.Nullable;
 import org.junit.After;
@@ -71,6 +70,8 @@ import org.junit.AssumptionViolatedException;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Load and dynamically generate a series of test cases to verify if the {@link Storage} and
@@ -86,7 +87,7 @@ import org.junit.runner.RunWith;
 @Parameterized(RetryConformanceParameterProvider.class)
 @ParallelFriendly
 public class ITRetryConformanceTest {
-  private static final Logger LOGGER = Logger.getLogger(ITRetryConformanceTest.class.getName());
+  private static final Logger LOGGER = LoggerFactory.getLogger(ITRetryConformanceTest.class);
 
   private RetryTestFixture retryTestFixture;
 
@@ -100,7 +101,7 @@ public class ITRetryConformanceTest {
 
   @Before
   public void setUp() throws Throwable {
-    LOGGER.fine("Running setup...");
+    LOGGER.trace("Running setup...");
     retryTestFixture = retryParameter.retryTestFixture;
     testRetryConformance = retryParameter.testRetryConformance;
     mapping = retryParameter.rpcMethodMapping;
@@ -111,12 +112,12 @@ public class ITRetryConformanceTest {
     // the case setup fails for some reason
     ctx = ctx(nonTestStorage, empty());
     ctx = mapping.getSetup().apply(ctx, testRetryConformance).leftMap(s -> testStorage);
-    LOGGER.fine("Running setup complete");
+    LOGGER.trace("Running setup complete");
   }
 
   @After
   public void tearDown() throws Throwable {
-    LOGGER.fine("Running teardown...");
+    LOGGER.trace("Running teardown...");
     if (ctx != null) {
       ctx = ctx.leftMap(s -> nonTestStorage);
       getReplaceStorageInObjectsFromCtx()
@@ -124,7 +125,7 @@ public class ITRetryConformanceTest {
           .apply(ctx, testRetryConformance);
     }
     retryTestFixture.finished(null);
-    LOGGER.fine("Running teardown complete");
+    LOGGER.trace("Running teardown complete");
   }
 
   /**
@@ -133,7 +134,7 @@ public class ITRetryConformanceTest {
    */
   @Test
   public void test() throws Throwable {
-    LOGGER.fine("Running test...");
+    LOGGER.trace("Running test...");
     assertThat(ctx).isNotNull();
     try {
       ctx =
@@ -146,7 +147,7 @@ public class ITRetryConformanceTest {
       retryTestFixture.failed(e, null);
       throw e;
     }
-    LOGGER.fine("Running test complete");
+    LOGGER.trace("Running test complete");
   }
 
   /**
@@ -374,7 +375,7 @@ public class ITRetryConformanceTest {
                   .collect(Collectors.toSet()));
 
       if (!unusedMappings.isEmpty()) {
-        LOGGER.warning(
+        LOGGER.warn(
             String.format(
                 Locale.US,
                 "Declared but unused mappings with ids: [%s]",
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java
index 028336c5..c5a61c79 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java
@@ -29,11 +29,12 @@ import com.google.cloud.storage.it.runner.registry.TestBench.RetryTestResource;
 import com.google.common.collect.ImmutableMap;
 import java.io.IOException;
 import java.util.Locale;
-import java.util.logging.Logger;
 import org.junit.AssumptionViolatedException;
 import org.junit.rules.TestRule;
 import org.junit.rules.TestWatcher;
 import org.junit.runner.Description;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A JUnit 4 {@link TestRule} which integrates with {@link TestBench} and {@link
@@ -44,7 +45,7 @@ import org.junit.runner.Description;
  * <p>Provides pre-configured instances of {@link Storage} for setup/teardown & test.
  */
 final class RetryTestFixture extends TestWatcher {
-  private static final Logger LOGGER = Logger.getLogger(RetryTestFixture.class.getName());
+  private static final Logger LOGGER = LoggerFactory.getLogger(RetryTestFixture.class);
   private static final int STATUS_CODE_NOT_IMPLEMENTED = 501;
 
   private final CleanupStrategy cleanupStrategy;
@@ -83,7 +84,7 @@ final class RetryTestFixture extends TestWatcher {
 
   @Override
   protected void starting(Description description) {
-    LOGGER.fine("Setting up retry_test resource...");
+    LOGGER.trace("Setting up retry_test resource...");
     RetryTestResource retryTestResource =
         RetryTestResource.newRetryTestResource(
             testRetryConformance.getMethod(),
@@ -93,20 +94,26 @@ final class RetryTestFixture extends TestWatcher {
       retryTest = testBench.createRetryTest(retryTestResource);
     } catch (HttpResponseException e) {
       if (e.getStatusCode() == STATUS_CODE_NOT_IMPLEMENTED) {
-        throw new AssumptionViolatedException(
-            "Testbench not yet implemented for " + retryTestResource);
+        AssumptionViolatedException exception =
+            new AssumptionViolatedException(
+                "Testbench not yet implemented for " + retryTestResource);
+        // make skips due to not implemented more terse
+        // we know where this comes from, we don't need the full stack trace for each of the
+        // 200+ occurrences.
+        exception.setStackTrace(new StackTraceElement[0]);
+        throw exception;
       } else {
         throw new RuntimeException(e);
       }
     } catch (IOException e) {
       throw new RuntimeException(e);
     }
-    LOGGER.fine("Setting up retry_test resource complete");
+    LOGGER.trace("Setting up retry_test resource complete");
   }
 
   @Override
   protected void finished(Description description) {
-    LOGGER.fine("Verifying end state of retry_test resource...");
+    LOGGER.trace("Verifying end state of retry_test resource...");
     try (Storage ignore1 = nonTestStorage;
         Storage ignore2 = testStorage) { // use try-with to shut down grpc resources
       try {
@@ -117,7 +124,7 @@ final class RetryTestFixture extends TestWatcher {
           }
         }
       } finally {
-        LOGGER.fine("Verifying end state of retry_test resource complete");
+        LOGGER.trace("Verifying end state of retry_test resource complete");
         if ((shouldCleanup(testSuccess, testSkipped)) && retryTest != null) {
           testBench.deleteRetryTest(retryTest);
           retryTest = null;
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java
index ef481f78..9ed0177e 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java
@@ -105,8 +105,9 @@ import java.util.Map.Entry;
 import java.util.OptionalInt;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
-import java.util.logging.Logger;
 import java.util.stream.Collectors;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A class which serves to try and organize all of the {@link RpcMethodMapping} for the retry
@@ -120,7 +121,7 @@ import java.util.stream.Collectors;
 @Immutable
 @SuppressWarnings("Guava")
 final class RpcMethodMappings {
-  private static final Logger LOGGER = Logger.getLogger(RpcMethodMappings.class.getName());
+  private static final Logger LOGGER = LoggerFactory.getLogger(RpcMethodMappings.class);
 
   private static final Predicate<TestRetryConformance> groupIsDownload =
       methodGroupIs("storage.objects.download");
@@ -224,7 +225,7 @@ final class RpcMethodMappings {
 
   private void reportMappingSummary() {
     int mappingCount = funcMap.values().stream().mapToInt(m -> 1).sum();
-    LOGGER.info("Current total number of mappings defined: " + mappingCount);
+    LOGGER.info("Current total number of mappings defined: {}", mappingCount);
     String counts =
         funcMap.asMap().entrySet().stream()
             .map(
@@ -244,7 +245,7 @@ final class RpcMethodMappings {
                 })
             .sorted()
             .collect(Collectors.joining("\n", "\n", ""));
-    LOGGER.info("Current number of mappings per rpc method: " + counts);
+    LOGGER.info("Current number of mappings per rpc method: {}", counts);
     OptionalInt max =
         funcMap.values().stream().map(RpcMethodMapping::getMappingId).mapToInt(i -> i).max();
     if (max.isPresent()) {
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/BucketCleaner.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/BucketCleaner.java
index a5d26502..67c8f65d 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/BucketCleaner.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/BucketCleaner.java
@@ -42,18 +42,18 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Locale;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public final class BucketCleaner {
 
-  private static final Logger LOGGER = Logger.getLogger(BucketCleaner.class.getName());
+  private static final Logger LOGGER = LoggerFactory.getLogger(BucketCleaner.class);
 
   public static void doCleanup(String bucketName, Storage s) {
-    LOGGER.fine("Starting bucket cleanup...");
+    LOGGER.trace("Starting bucket cleanup...");
     String projectId = s.getOptions().getProjectId();
     try {
       // TODO: probe bucket existence, a bad test could have deleted the bucket
@@ -73,16 +73,16 @@ public final class BucketCleaner {
       if (!anyFailedObjectDeletes) {
         s.delete(bucketName, BucketSourceOption.userProject(projectId));
       } else {
-        LOGGER.warning("Unable to delete bucket due to previous failed object deletes");
+        LOGGER.warn("Unable to delete bucket due to previous failed object deletes");
       }
-      LOGGER.fine("Bucket cleanup complete");
+      LOGGER.trace("Bucket cleanup complete");
     } catch (Exception e) {
-      LOGGER.log(Level.SEVERE, e, () -> "Error during bucket cleanup.");
+      LOGGER.error("Error during bucket cleanup.");
     }
   }
 
   public static void doCleanup(String bucketName, Storage s, StorageControlClient ctrl) {
-    LOGGER.warning("Starting bucket cleanup: " + bucketName);
+    LOGGER.warn("Starting bucket cleanup: {}", bucketName);
     String projectId = s.getOptions().getProjectId();
     try {
       // TODO: probe bucket existence, a bad test could have deleted the bucket
@@ -140,7 +140,7 @@ public final class BucketCleaner {
                       folder -> {
                         String formatted =
                             String.format(Locale.US, "folder = %s", folder.getName());
-                        LOGGER.warning(formatted);
+                        LOGGER.warn(formatted);
                         boolean success = true;
                         try {
                           ctrl.deleteFolderCallable()
@@ -176,7 +176,7 @@ public final class BucketCleaner {
                       managedFolder -> {
                         String formatted =
                             String.format(Locale.US, "managedFolder = %s", managedFolder.getName());
-                        LOGGER.warning(formatted);
+                        LOGGER.warn(formatted);
                         boolean success = true;
                         try {
                           ctrl.deleteManagedFolderCallable()
@@ -214,7 +214,7 @@ public final class BucketCleaner {
       if (!anyFailedObjectDelete && !anyFailedFolderDelete && !anyFailedManagedFolderDelete) {
         s.delete(bucketName, BucketSourceOption.userProject(projectId));
       } else {
-        LOGGER.warning(
+        LOGGER.warn(
             String.format(
                 Locale.US,
                 "Unable to delete bucket %s due to previous failed %s deletes",
@@ -222,9 +222,9 @@ public final class BucketCleaner {
                 failed));
       }
 
-      LOGGER.warning("Bucket cleanup complete: " + bucketName);
+      LOGGER.warn("Bucket cleanup complete: {}", bucketName);
     } catch (Exception e) {
-      LOGGER.log(Level.SEVERE, e, () -> "Error during bucket cleanup.");
+      LOGGER.error("Error during bucket cleanup.");
     }
   }
 
@@ -234,7 +234,7 @@ public final class BucketCleaner {
         deleteResults.stream().filter(r -> !r.success).collect(Collectors.toList());
     failedDeletes.forEach(
         r ->
-            LOGGER.warning(
+            LOGGER.warn(
                 String.format(
                     Locale.US, "Failed to delete %s %s/%s", resourceType, bucketName, r.name)));
     return !failedDeletes.isEmpty();
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/GrpcPlainRequestLoggingInterceptor.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/GrpcPlainRequestLoggingInterceptor.java
index 276927e0..0f619524 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/GrpcPlainRequestLoggingInterceptor.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/GrpcPlainRequestLoggingInterceptor.java
@@ -50,11 +50,11 @@ import java.util.Map;
 import java.util.Set;
 import java.util.function.Function;
 import java.util.function.Supplier;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import org.checkerframework.checker.nullness.qual.NonNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Client side interceptor which will log gRPC request, headers, response, status and trailers in
@@ -67,7 +67,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
 public final class GrpcPlainRequestLoggingInterceptor implements ClientInterceptor {
 
   private static final Logger LOGGER =
-      Logger.getLogger(GrpcPlainRequestLoggingInterceptor.class.getName());
+      LoggerFactory.getLogger(GrpcPlainRequestLoggingInterceptor.class);
 
   private static final GrpcPlainRequestLoggingInterceptor INSTANCE =
       new GrpcPlainRequestLoggingInterceptor();
@@ -117,14 +117,13 @@ public final class GrpcPlainRequestLoggingInterceptor implements ClientIntercept
       @Override
       public void start(Listener<RespT> responseListener, Metadata headers) {
         if (headers.containsKey(X_GOOG_REQUEST_PARAMS)) {
-          LOGGER.log(Level.CONFIG, () -> String.format(">>> headers = %s", headers));
+          LOGGER.atDebug().log(() -> String.format(">>> headers = %s", headers));
         }
         SimpleForwardingClientCallListener<RespT> listener =
             new SimpleForwardingClientCallListener<RespT>(responseListener) {
               @Override
               public void onMessage(RespT message) {
-                LOGGER.log(
-                    Level.CONFIG,
+                LOGGER.atDebug().log(
                     () ->
                         String.format(
                             Locale.US,
@@ -136,7 +135,7 @@ public final class GrpcPlainRequestLoggingInterceptor implements ClientIntercept
 
               @Override
               public void onClose(Status status, Metadata trailers) {
-                LOGGER.log(Level.CONFIG, lazyOnCloseLogString(status, trailers));
+                LOGGER.atDebug().log(lazyOnCloseLogString(status, trailers));
                 super.onClose(status, trailers);
               }
             };
@@ -145,8 +144,7 @@ public final class GrpcPlainRequestLoggingInterceptor implements ClientIntercept
 
       @Override
       public void sendMessage(ReqT message) {
-        LOGGER.log(
-            Level.CONFIG,
+        LOGGER.atDebug().log(
             () ->
                 String.format(
                     Locale.US,
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBlobWriteChannelTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBlobWriteChannelTest.java
index 8697b07c..d910a68d 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBlobWriteChannelTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBlobWriteChannelTest.java
@@ -63,7 +63,6 @@ import java.time.format.DateTimeFormatter;
 import java.util.Arrays;
 import java.util.Locale;
 import java.util.Optional;
-import java.util.logging.Logger;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -71,7 +70,6 @@ import org.junit.runner.RunWith;
 @SingleBackend(Backend.TEST_BENCH)
 public final class ITBlobWriteChannelTest {
 
-  private static final Logger LOGGER = Logger.getLogger(ITBlobWriteChannelTest.class.getName());
   private static final String NOW_STRING;
   private static final String BLOB_STRING_CONTENT = "Hello Google Cloud Storage!";
 
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketReadMaskTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketReadMaskTest.java
index c4c3c405..36991f1b 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketReadMaskTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITBucketReadMaskTest.java
@@ -98,6 +98,7 @@ public final class ITBucketReadMaskTest {
     public ImmutableList<?> parameters() {
       ImmutableList<Args<BucketField, BucketInfo>> args =
           ImmutableList.of(
+              new Args<>(BucketField.PROJECT, LazyAssertion.equal()),
               new Args<>(BucketField.ACL, LazyAssertion.equal()),
               new Args<>(BucketField.AUTOCLASS, LazyAssertion.equal()),
               new Args<>(BucketField.BILLING, LazyAssertion.equal()),
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITNotificationTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITNotificationTest.java
index b666a9ee..5e4e2497 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITNotificationTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITNotificationTest.java
@@ -39,12 +39,12 @@ import java.io.IOException;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @RunWith(StorageITRunner.class)
 @CrossRun(
@@ -53,7 +53,7 @@ import org.junit.runner.RunWith;
 public class ITNotificationTest {
   private static final Notification.PayloadFormat PAYLOAD_FORMAT = PayloadFormat.JSON_API_V1;
   private static final Map<String, String> CUSTOM_ATTRIBUTES = ImmutableMap.of("label1", "value1");
-  private static final Logger log = Logger.getLogger(ITNotificationTest.class.getName());
+  private static final Logger LOGGER = LoggerFactory.getLogger(ITNotificationTest.class);
   private static final String DOES_NOT_EXIST_ID = "something-that-does-not-exist-probably";
 
   @Inject public Backend backend;
@@ -110,7 +110,7 @@ public class ITNotificationTest {
         topicAdminClient.deleteTopic(topic);
         topicAdminClient.close();
       } catch (Exception e) {
-        log.log(Level.WARNING, "Error while trying to delete topic and shutdown topic client", e);
+        LOGGER.warn("Error while trying to delete topic and shutdown topic client", e);
       }
       topicAdminClient = null;
     }
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITOptionRegressionTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITOptionRegressionTest.java
index 130bd0e1..905fe547 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITOptionRegressionTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITOptionRegressionTest.java
@@ -328,7 +328,7 @@ public final class ITOptionRegressionTest {
             "website",
             "softDeletePolicy",
             "hierarchicalNamespace",
-            "website");
+            "projectNumber");
     s.get(
         b.getName(),
         BucketGetOption.fields(TestUtils.filterOutHttpOnlyBucketFields(BucketField.values())));
@@ -821,7 +821,7 @@ public final class ITOptionRegressionTest {
             "items/website",
             "items/softDeletePolicy",
             "items/hierarchicalNamespace",
-            "items/website");
+            "items/projectNumber");
     s.list(BucketListOption.fields(TestUtils.filterOutHttpOnlyBucketFields(BucketField.values())));
     requestAuditing.assertQueryParam("fields", expected, splitOnCommaToSet());
   }
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/StorageITLeafRunner.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/StorageITLeafRunner.java
index cb4ddbf8..d8e0a784 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/StorageITLeafRunner.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/StorageITLeafRunner.java
@@ -26,7 +26,6 @@ import java.lang.reflect.Modifier;
 import java.util.List;
 import java.util.Locale;
 import java.util.Objects;
-import java.util.logging.Logger;
 import org.checkerframework.checker.nullness.qual.Nullable;
 import org.junit.ClassRule;
 import org.junit.Rule;
@@ -36,6 +35,7 @@ import org.junit.runners.BlockJUnit4ClassRunner;
 import org.junit.runners.model.FrameworkMethod;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.TestClass;
+import org.slf4j.LoggerFactory;
 
 final class StorageITLeafRunner extends BlockJUnit4ClassRunner {
   private final CrossRunIntersection crossRunIntersection;
@@ -111,7 +111,7 @@ final class StorageITLeafRunner extends BlockJUnit4ClassRunner {
             "Using @Test(timeout = 1), @Rule Timeout or @ClassRule Timeout can break multi-thread"
                 + " and Fixture support of StorageITRunner. Please refactor your test to detect a"
                 + " timeout in the test itself.";
-        Logger.getLogger(StorageITRunner.class.getName()).warning(msg);
+        LoggerFactory.getLogger(StorageITRunner.class).warn(msg);
       }
     }
     super.validateTestMethods(errors);
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestBench.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestBench.java
index 3cc9360f..7734794a 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestBench.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestBench.java
@@ -58,10 +58,10 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Optional;
 import java.util.concurrent.TimeUnit;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A {@link ManagedLifecycle} which integrates with the <a target="_blank"
@@ -89,7 +89,7 @@ import java.util.regex.Pattern;
  */
 public final class TestBench implements ManagedLifecycle {
 
-  private static final Logger LOGGER = Logger.getLogger(TestBench.class.getName());
+  private static final Logger LOGGER = LoggerFactory.getLogger(TestBench.class);
 
   private final boolean ignorePullError;
   private final String baseUri;
@@ -206,8 +206,8 @@ public final class TestBench implements ManagedLifecycle {
 
       File outFile = outPath.toFile();
       File errFile = errPath.toFile();
-      LOGGER.info("Redirecting server stdout to: " + outFile.getAbsolutePath());
-      LOGGER.info("Redirecting server stderr to: " + errFile.getAbsolutePath());
+      LOGGER.info("Redirecting server stdout to: {}", outFile.getAbsolutePath());
+      LOGGER.info("Redirecting server stderr to: {}", errFile.getAbsolutePath());
       String dockerImage = String.format(Locale.US, "%s:%s", dockerImageName, dockerImageTag);
       // First try and pull the docker image, this validates docker is available and running
       // on the host, as well as gives time for the image to be downloaded independently of
@@ -263,7 +263,7 @@ public final class TestBench implements ManagedLifecycle {
               .redirectOutput(outFile)
               .redirectError(errFile)
               .start();
-      LOGGER.log(Level.INFO, command.toString());
+      LOGGER.info(command.toString());
       try {
         // wait a small amount of time for the server to come up before probing
         Thread.sleep(500);
@@ -317,22 +317,19 @@ public final class TestBench implements ManagedLifecycle {
         if (processExitValue != 0) {
           attemptForceStopContainer = true;
         }
-        System.out.println("processExitValue = " + processExitValue);
-        LOGGER.warning("Container exit value = " + processExitValue);
+        LOGGER.warn("Container exit value = {}", processExitValue);
       } catch (IllegalThreadStateException e) {
         attemptForceStopContainer = true;
       }
 
       if (attemptForceStopContainer) {
-        LOGGER.warning("Container did not gracefully exit, attempting to explicitly stop it.");
-        System.out.println("Container did not gracefully exit, attempting to explicitly stop it.");
+        LOGGER.warn("Container did not gracefully exit, attempting to explicitly stop it.");
         ImmutableList<String> command = ImmutableList.of("docker", "kill", containerName);
-        System.out.println("command = " + command);
-        LOGGER.log(Level.WARNING, command.toString());
+        LOGGER.warn(command.toString());
         Process shutdownProcess = new ProcessBuilder(command).start();
         shutdownProcess.waitFor(5, TimeUnit.SECONDS);
         int shutdownProcessExitValue = shutdownProcess.exitValue();
-        LOGGER.warning("Container exit value = " + shutdownProcessExitValue);
+        LOGGER.warn("Container exit value = {}", shutdownProcessExitValue);
       }
 
       // wait for the server to shutdown
@@ -373,10 +370,10 @@ public final class TestBench implements ManagedLifecycle {
 
   private void dumpServerLogs(Path outFile, Path errFile) throws IOException {
     try {
-      LOGGER.warning("Dumping contents of stdout");
+      LOGGER.warn("Dumping contents of stdout");
       dumpServerLog("stdout", outFile.toFile());
     } finally {
-      LOGGER.warning("Dumping contents of stderr");
+      LOGGER.warn("Dumping contents of stderr");
       dumpServerLog("stderr", errFile.toFile());
     }
   }
@@ -385,7 +382,7 @@ public final class TestBench implements ManagedLifecycle {
     try (BufferedReader reader = new BufferedReader(new FileReader(out))) {
       String line;
       while ((line = reader.readLine()) != null) {
-        LOGGER.warning("<" + prefix + "> " + line);
+        LOGGER.warn("<{}> {}", prefix, line);
       }
     }
   }
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/jqwik/BucketArbitraryProvider.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/jqwik/BucketArbitraryProvider.java
index c5d361ea..1839c32b 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/jqwik/BucketArbitraryProvider.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/jqwik/BucketArbitraryProvider.java
@@ -18,7 +18,7 @@ package com.google.cloud.storage.jqwik;
 
 import static com.google.cloud.storage.PackagePrivateMethodWorkarounds.ifNonNull;
 
-import com.google.cloud.storage.jqwik.StorageArbitraries.ProjectID;
+import com.google.cloud.storage.jqwik.StorageArbitraries.ProjectNumber;
 import com.google.storage.v2.Bucket;
 import com.google.storage.v2.BucketName;
 import com.google.storage.v2.ProjectName;
@@ -76,7 +76,7 @@ public final class BucketArbitraryProvider implements ArbitraryProvider {
                         StorageArbitraries.etag())
                     .as(Tuple::of),
                 Combinators.combine(
-                        StorageArbitraries.projectID().map(ProjectID::toProjectName),
+                        StorageArbitraries.projectNumber().map(ProjectNumber::toProjectName),
                         StorageArbitraries
                             .alnum() // ignored for now, tuples can't be a single element
                         )
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/jqwik/StorageArbitraries.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/jqwik/StorageArbitraries.java
index 8750a293..f5ee93ce 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/jqwik/StorageArbitraries.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/jqwik/StorageArbitraries.java
@@ -138,6 +138,10 @@ public final class StorageArbitraries {
         .as((first, mid, last) -> new ProjectID(first + mid + last));
   }
 
+  public static Arbitrary<ProjectNumber> projectNumber() {
+    return Arbitraries.bigIntegers().greaterOrEqual(BigInteger.ONE).map(ProjectNumber::new);
+  }
+
   public static Arbitrary<String> kmsKey() {
     return Arbitraries.of("kms-key1", "kms-key2").injectNull(0.75);
   }
@@ -444,6 +448,23 @@ public final class StorageArbitraries {
     }
   }
 
+  public static final class ProjectNumber {
+
+    private final BigInteger value;
+
+    private ProjectNumber(BigInteger value) {
+      this.value = value;
+    }
+
+    public BigInteger get() {
+      return value;
+    }
+
+    public ProjectName toProjectName() {
+      return ProjectName.of(value.toString());
+    }
+  }
+
   public static Objects objects() {
     return Objects.INSTANCE;
   }
diff --git a/samples/snippets/src/test/java/com/example/storage/Env.java b/samples/snippets/src/test/java/com/example/storage/Env.java
new file mode 100644
index 00000000..91ab9d72
--- /dev/null
+++ b/samples/snippets/src/test/java/com/example/storage/Env.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.storage;
+
+import com.google.cloud.storage.Acl.User;
+
+public final class Env {
+
+  public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL");
+  public static final User IT_SERVICE_ACCOUNT_USER = new User(IT_SERVICE_ACCOUNT_EMAIL);
+  public static final String GOOGLE_CLOUD_PROJECT = System.getenv("GOOGLE_CLOUD_PROJECT");
+  public static final String GOOGLE_CLOUD_PROJECT_NUMBER =
+      System.getenv("GOOGLE_CLOUD_PROJECT_NUMBER");
+  public static final String JOB_TYPE = System.getenv("JOB_TYPE");
+
+  private Env() {}
+}
diff --git a/samples/snippets/src/test/java/com/example/storage/ITBucketSnippets.java b/samples/snippets/src/test/java/com/example/storage/ITBucketSnippets.java
index 58444c6e..051bd05e 100644
--- a/samples/snippets/src/test/java/com/example/storage/ITBucketSnippets.java
+++ b/samples/snippets/src/test/java/com/example/storage/ITBucketSnippets.java
@@ -111,7 +111,7 @@ public class ITBucketSnippets {
 
   private static final Logger log = Logger.getLogger(ITBucketSnippets.class.getName());
   private static final String BUCKET = RemoteStorageHelper.generateBucketName();
-  private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
+  private static final String PROJECT_ID = Env.GOOGLE_CLOUD_PROJECT;
   private static final String KMS_KEY_NAME =
       "projects/cloud-java-ci-sample/locations/us/keyRings/"
           + "gcs_test_kms_key_ring/cryptoKeys/gcs_kms_key_one";
diff --git a/samples/snippets/src/test/java/com/example/storage/ITCleanupOldBucketsTest.java b/samples/snippets/src/test/java/com/example/storage/ITCleanupOldBucketsTest.java
new file mode 100644
index 00000000..0360aa18
--- /dev/null
+++ b/samples/snippets/src/test/java/com/example/storage/ITCleanupOldBucketsTest.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.storage;
+
+import com.google.api.gax.paging.Page;
+import com.google.cloud.storage.Bucket;
+import com.google.cloud.storage.BucketInfo;
+import com.google.cloud.storage.Storage;
+import com.google.cloud.storage.Storage.BucketField;
+import com.google.cloud.storage.Storage.BucketListOption;
+import com.google.cloud.storage.TransportCompatibility.Transport;
+import com.google.cloud.storage.it.BucketCleaner;
+import com.google.cloud.storage.it.runner.StorageITRunner;
+import com.google.cloud.storage.it.runner.annotations.Backend;
+import com.google.cloud.storage.it.runner.annotations.Inject;
+import com.google.cloud.storage.it.runner.annotations.SingleBackend;
+import com.google.cloud.storage.it.runner.annotations.StorageFixture;
+import com.google.common.collect.ImmutableList;
+import com.google.storage.control.v2.StorageControlClient;
+import java.time.Instant;
+import java.time.OffsetDateTime;
+import java.time.ZoneOffset;
+import java.util.UUID;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(StorageITRunner.class)
+@SingleBackend(Backend.PROD)
+public final class ITCleanupOldBucketsTest {
+
+  @Inject
+  @StorageFixture(Transport.HTTP)
+  public Storage storage;
+  @Inject
+  public StorageControlClient ctrl;
+  @Inject
+  public BucketInfo bucket;
+
+  @Test
+  public void cleanupOldBuckets() {
+    Page<Bucket> page = storage.list(
+        BucketListOption.fields(BucketField.NAME, BucketField.TIME_CREATED));
+
+    String bucketNamePrefix = bucket.getName().substring(0, UUID.randomUUID().toString().length());
+
+    OffsetDateTime now = Instant.now().atOffset(ZoneOffset.UTC);
+    OffsetDateTime twentyFourHoursAgo = now.minusHours(24);
+
+    ImmutableList<String> bucketsToClean = page.streamAll()
+        .map(Bucket::asBucketInfo)
+        .filter(bucket -> {
+          OffsetDateTime ctime = bucket.getCreateTimeOffsetDateTime();
+          String name = bucket.getName();
+          return ctime.isBefore(twentyFourHoursAgo)
+              && (name.startsWith("gcloud") || name.startsWith(bucketNamePrefix));
+        })
+        .map(BucketInfo::getName)
+        .collect(ImmutableList.toImmutableList());
+
+    for (String bucketName : bucketsToClean) {
+      BucketCleaner.doCleanup(bucketName, storage, ctrl);
+    }
+  }
+}
diff --git a/samples/snippets/src/test/java/com/example/storage/ITHmacSnippets.java b/samples/snippets/src/test/java/com/example/storage/ITHmacSnippets.java
index 4e277496..db548e88 100644
--- a/samples/snippets/src/test/java/com/example/storage/ITHmacSnippets.java
+++ b/samples/snippets/src/test/java/com/example/storage/ITHmacSnippets.java
@@ -19,6 +19,7 @@ package com.example.storage;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeFalse;
 
 import com.example.storage.hmac.ActivateHmacKey;
 import com.example.storage.hmac.CreateHmacKey;
@@ -33,10 +34,8 @@ import com.google.cloud.storage.HmacKey.HmacKeyMetadata;
 import com.google.cloud.storage.HmacKey.HmacKeyState;
 import com.google.cloud.storage.ServiceAccount;
 import com.google.cloud.storage.Storage;
-import com.google.cloud.testing.junit4.MultipleAttemptsRule;
 import org.junit.Assert;
 import org.junit.Before;
-import org.junit.Rule;
 import org.junit.Test;
 
 public class ITHmacSnippets extends TestBase {
@@ -46,11 +45,19 @@ public class ITHmacSnippets extends TestBase {
 
   @Before
   public void before() {
+    // Skip running Hmac snippet tests in CI
+    // All of our samples CI uses a single service account. Each service account can only have 5
+    // HMAC keys.
+    // We have 6 test scenarios defined.
+    // If more than one build is running at the same time they will fight with each other's limit
+    // These samples have not materially changed since 2022-03 (as of 2025-05).
+    // Additionally, we have more robust integration tests for HMAC operations in the library
+    // itself.
+    assumeFalse("skipping hmac snippet tests in CI due to racy interactions",
+        "samples".equals(Env.JOB_TYPE));
     cleanUpHmacKeys(ServiceAccount.of(HMAC_KEY_TEST_SERVICE_ACCOUNT));
   }
 
-  @Rule public MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(5, 2000L);
-
   private void cleanUpHmacKeys(ServiceAccount serviceAccount) {
     Page<HmacKey.HmacKeyMetadata> metadatas =
         storage.listHmacKeys(Storage.ListHmacKeysOption.serviceAccount(serviceAccount));
diff --git a/samples/snippets/src/test/java/com/example/storage/ITObjectSnippets.java b/samples/snippets/src/test/java/com/example/storage/ITObjectSnippets.java
index 61dbeb47..6db8a5ca 100644
--- a/samples/snippets/src/test/java/com/example/storage/ITObjectSnippets.java
+++ b/samples/snippets/src/test/java/com/example/storage/ITObjectSnippets.java
@@ -16,6 +16,8 @@
 
 package com.example.storage;
 
+import static com.example.storage.Env.GOOGLE_CLOUD_PROJECT;
+import static com.google.common.truth.Truth.assertThat;
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
@@ -57,17 +59,24 @@ import com.example.storage.object.UploadEncryptedObject;
 import com.example.storage.object.UploadKmsEncryptedObject;
 import com.example.storage.object.UploadObject;
 import com.example.storage.object.UploadObjectFromMemory;
+import com.google.cloud.kms.v1.CryptoKey;
 import com.google.cloud.storage.Acl;
 import com.google.cloud.storage.Blob;
 import com.google.cloud.storage.BlobId;
 import com.google.cloud.storage.BlobInfo;
+import com.google.cloud.storage.Bucket;
 import com.google.cloud.storage.BucketInfo;
-import com.google.cloud.storage.Storage;
+import com.google.cloud.storage.BucketInfo.IamConfiguration;
+import com.google.cloud.storage.DataGenerator;
+import com.google.cloud.storage.Storage.BlobTargetOption;
+import com.google.cloud.storage.Storage.BlobWriteOption;
+import com.google.cloud.storage.Storage.BucketTargetOption;
 import com.google.cloud.storage.StorageClass;
+import com.google.cloud.storage.TmpFile;
 import com.google.cloud.storage.it.BucketCleaner;
-import com.google.cloud.storage.testing.RemoteStorageHelper;
-import com.google.cloud.testing.junit4.MultipleAttemptsRule;
-import com.google.cloud.testing.junit4.StdOutCaptureRule;
+import com.google.cloud.storage.it.TemporaryBucket;
+import com.google.cloud.storage.it.runner.annotations.Inject;
+import com.google.cloud.storage.it.runner.registry.KmsFixture;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.io.BaseEncoding;
 import java.io.File;
@@ -76,126 +85,118 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URL;
 import java.nio.file.Files;
+import java.nio.file.Path;
 import java.time.Duration;
 import java.util.Date;
-import java.util.Map;
 import java.util.Random;
-import java.util.logging.Logger;
 import javax.net.ssl.HttpsURLConnection;
-import org.junit.AfterClass;
 import org.junit.Assert;
-import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.ExpectedException;
+import org.junit.rules.TemporaryFolder;
 
-public class ITObjectSnippets {
+public class ITObjectSnippets extends TestBase {
 
-  private static final Logger log = Logger.getLogger(ITObjectSnippets.class.getName());
-  private static final String BUCKET = RemoteStorageHelper.generateBucketName();
-  private static final String BLOB = "blob";
   private static final String STRING_CONTENT = "Hello, World!";
   private static final byte[] CONTENT = STRING_CONTENT.getBytes(UTF_8);
-  private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
-  private static final String KMS_KEY_NAME =
-      "projects/cloud-java-ci-sample/locations/us/keyRings/"
-          + "gcs_test_kms_key_ring/cryptoKeys/gcs_kms_key_one";
 
-  private static Storage storage;
+  @Rule public final TemporaryFolder tmpDir = new TemporaryFolder();
 
-  @Rule public final StdOutCaptureRule stdOutCaptureRule = new StdOutCaptureRule();
-
-  @Rule public MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(5);
-
-  @Rule public ExpectedException thrown = ExpectedException.none();
-
-  @BeforeClass
-  public static void beforeClass() {
-    RemoteStorageHelper helper = RemoteStorageHelper.create();
-    storage = helper.getOptions().getService();
-    storage.create(BucketInfo.of(BUCKET));
-    storage.create(BlobInfo.newBuilder(BUCKET, BLOB).build(), CONTENT);
-  }
-
-  @AfterClass
-  public static void afterClass() throws Exception {
-    try (Storage ignore = storage) {
-      BucketCleaner.doCleanup(BUCKET, storage);
-    }
-  }
+  @Inject public KmsFixture kmsFixture;
 
   @Test
   public void testChangeObjectStorageClass() {
-    Blob blob = storage.get(BUCKET, BLOB);
-    Assert.assertNotEquals(StorageClass.COLDLINE, blob.getStorageClass());
-    ChangeObjectStorageClass.changeObjectStorageClass(PROJECT_ID, BUCKET, BLOB);
-    assertEquals(StorageClass.COLDLINE, storage.get(BUCKET, BLOB).getStorageClass());
-    assertArrayEquals(CONTENT, storage.get(BUCKET, BLOB).getContent());
+    String objectName = generator.randomObjectName();
+    BlobInfo gen1 = storage.create(info(objectName), CONTENT, BlobTargetOption.doesNotExist());
+    Assert.assertNotEquals(StorageClass.COLDLINE, gen1.getStorageClass());
+    ChangeObjectStorageClass.changeObjectStorageClass(
+        GOOGLE_CLOUD_PROJECT, bucket.getName(), objectName);
+    Blob gen2 = storage.get(bucket.getName(), objectName);
+    assertEquals(StorageClass.COLDLINE, gen2.getStorageClass());
+    assertArrayEquals(CONTENT, gen2.getContent());
   }
 
   @Test
   public void testCopyObject() throws Exception {
-    String newBucket = RemoteStorageHelper.generateBucketName();
-    storage.create(BucketInfo.newBuilder(newBucket).build());
-    try {
-      CopyObject.copyObject(PROJECT_ID, BUCKET, BLOB, newBucket);
-      assertNotNull(storage.get(newBucket, BLOB));
-    } finally {
-      storage.delete(newBucket, BLOB);
-      storage.delete(newBucket);
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName()).build())
+        .setStorage(storage)
+        .build()) {
+
+      String newBucket = tmpBucket.getBucket().getName();
+
+      String objectName = generator.randomObjectName();
+      storage.create(info(objectName));
+      CopyObject.copyObject(GOOGLE_CLOUD_PROJECT, bucket.getName(), objectName, newBucket);
+      assertNotNull(storage.get(newBucket, objectName));
     }
   }
 
   @Test
   public void testDeleteObject() {
-    String blob = "deletethisblob";
-    storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, blob)).build());
-    assertNotNull(storage.get(BUCKET, blob));
-    DeleteObject.deleteObject(PROJECT_ID, BUCKET, blob);
-    assertNull(storage.get(BUCKET, blob));
+    String blob = generator.randomObjectName();
+    storage.create(BlobInfo.newBuilder(BlobId.of(bucket.getName(), blob)).build());
+    assertNotNull(storage.get(bucket.getName(), blob));
+    DeleteObject.deleteObject(GOOGLE_CLOUD_PROJECT, bucket.getName(), blob);
+    assertNull(storage.get(bucket.getName(), blob));
   }
 
   @Test
-  public void testDownloadObject() throws IOException {
-    File tempFile = File.createTempFile("file", ".txt");
-    try {
-      DownloadObject.downloadObject(PROJECT_ID, BUCKET, BLOB, tempFile.getPath());
-      assertEquals("Hello, World!", new String(Files.readAllBytes(tempFile.toPath())));
-    } finally {
-      tempFile.delete();
+  public void testDownloadObject() throws Exception {
+    Path baseDir = tmpDir.getRoot().toPath();
+    try (TmpFile file1 = DataGenerator.base64Characters().tempFile(baseDir, 13)) {
+      String objectName = generator.randomObjectName();
+      storage.createFrom(info(objectName), file1.getPath(), BlobWriteOption.doesNotExist());
+      DownloadObject.downloadObject(
+          GOOGLE_CLOUD_PROJECT, bucket.getName(), objectName, file1.getPath().toString());
+      byte[] expected = Files.readAllBytes(file1.getPath());
+      byte[] actual = storage.readAllBytes(bucket.getName(), objectName);
+      assertArrayEquals(expected, actual);
     }
   }
 
   @Test
   public void testDownloadObjectIntoMemory() throws IOException {
-    DownloadObjectIntoMemory.downloadObjectIntoMemory(PROJECT_ID, BUCKET, BLOB);
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
+    String objectName = generator.randomObjectName();
+    storage.create(info(objectName), CONTENT, BlobTargetOption.doesNotExist());
+    DownloadObjectIntoMemory.downloadObjectIntoMemory(
+        GOOGLE_CLOUD_PROJECT, bucket.getName(), objectName);
+    String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
+    assertThat(snippetOutput).contains("The contents of " + objectName);
   }
 
   @Test
-  public void testDownloadPublicObject() throws IOException {
-    String publicBlob = "publicblob" + System.currentTimeMillis();
-    BlobId publicBlobId = BlobId.of(BUCKET, publicBlob);
-    storage.create(BlobInfo.newBuilder(publicBlobId).build(), CONTENT);
-    storage.createAcl(publicBlobId, Acl.of(Acl.User.ofAllUsers(), Acl.Role.READER));
-    File tempFile = File.createTempFile("file", ".txt");
-    try {
-      DownloadPublicObject.downloadPublicObject(BUCKET, publicBlob, tempFile.toPath());
+  public void testDownloadPublicObject() throws Exception {
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName())
+            .setIamConfiguration(IamConfiguration.newBuilder()
+                .setIsUniformBucketLevelAccessEnabled(false)
+                .build())
+            .build())
+        .setStorage(storage)
+        .build()) {
+      String bucketName = tmpBucket.getBucket().getName();
+
+      String publicBlob = generator.randomObjectName();
+      BlobId publicBlobId = BlobId.of(bucketName, publicBlob);
+      Blob gen1 = storage.create(BlobInfo.newBuilder(publicBlobId).build(), CONTENT,
+          BlobTargetOption.doesNotExist());
+      storage.createAcl(gen1.getBlobId(), Acl.of(Acl.User.ofAllUsers(), Acl.Role.READER));
+      File tempFile = tmpDir.newFile("file.txt");
+      DownloadPublicObject.downloadPublicObject(bucketName, publicBlob, tempFile.toPath());
       assertEquals("Hello, World!", new String(Files.readAllBytes(tempFile.toPath())));
-    } finally {
-      tempFile.delete();
     }
   }
 
   @Test
   public void testGetObjectMetadata() {
-    String blobName = "test-create-empty-blob";
-    BlobId blobId = BlobId.of(BUCKET, blobName);
+    String blobName = generator.randomObjectName();
+    BlobId blobId = BlobId.of(bucket.getName(), blobName);
     BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setMetadata(ImmutableMap.of("k", "v")).build();
     Blob remoteBlob = storage.create(blobInfo, CONTENT);
     assertNotNull(remoteBlob);
-    GetObjectMetadata.getObjectMetadata(PROJECT_ID, BUCKET, blobName);
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
+    GetObjectMetadata.getObjectMetadata(GOOGLE_CLOUD_PROJECT, bucket.getName(), blobName);
+    String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
     assertTrue(snippetOutput.contains("Bucket: " + remoteBlob.getBucket()));
     assertTrue(snippetOutput.contains("Bucket: " + remoteBlob.getBucket()));
     assertTrue(snippetOutput.contains("CacheControl: " + remoteBlob.getCacheControl()));
@@ -230,132 +231,174 @@ public class ITObjectSnippets {
 
   @Test
   public void testListObjects() {
-    ListObjects.listObjects(PROJECT_ID, BUCKET);
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
-    assertTrue(snippetOutput.contains(BLOB));
+    String name1 = generator.randomObjectName();
+    storage.create(info(name1), BlobTargetOption.doesNotExist());
+    ListObjects.listObjects(GOOGLE_CLOUD_PROJECT, bucket.getName());
+    String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
+    assertTrue(snippetOutput.contains(name1));
   }
 
   @Test
   public void testListObjectsWithPrefix() {
-    storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, "a/1.txt")).build());
-    storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, "a/b/2.txt")).build());
-    storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, "a/b/3.txt")).build());
-    ListObjectsWithPrefix.listObjectsWithPrefix(PROJECT_ID, BUCKET, "a/");
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
+    String prefix = generator.randomObjectName();
+    storage.create(BlobInfo.newBuilder(bucket.getName(), prefix + "a/1.txt").build());
+    storage.create(BlobInfo.newBuilder(bucket.getName(), prefix + "a/b/2.txt").build());
+    storage.create(BlobInfo.newBuilder(bucket.getName(), prefix + "a/b/3.txt").build());
+    ListObjectsWithPrefix.listObjectsWithPrefix(
+        GOOGLE_CLOUD_PROJECT, bucket.getName(), prefix + "a/");
+    String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
     assertTrue(snippetOutput.contains("a/1.txt"));
     assertTrue(snippetOutput.contains("a/b/"));
     assertFalse(snippetOutput.contains("a/b/2.txt"));
   }
 
   @Test
-  public void testMoveObject() {
-    String blob = "movethisblob";
-    String newBlob = "movedthisblob";
-
-    storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, blob)).build());
-    assertNotNull(storage.get(BUCKET, blob));
-    String newBucket = RemoteStorageHelper.generateBucketName();
-    storage.create(BucketInfo.newBuilder(newBucket).build());
-    try {
-      MoveObject.moveObject(PROJECT_ID, BUCKET, blob, newBucket, newBlob);
+  public void testMoveObject() throws Exception {
+    String blob = generator.randomObjectName();
+    String newBlob = generator.randomObjectName();
+
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName()).build())
+        .setStorage(storage)
+        .build()) {
+
+      String newBucket = tmpBucket.getBucket().getName();
+      BlobInfo gen1 =
+          storage.create(BlobInfo.newBuilder(BlobId.of(newBucket, blob)).build());
+      MoveObject.moveObject(GOOGLE_CLOUD_PROJECT, newBucket, blob, newBucket, newBlob);
       assertNotNull(storage.get(newBucket, newBlob));
-      assertNull(storage.get(BUCKET, blob));
-    } finally {
-      storage.delete(newBucket, newBlob);
-      storage.delete(newBucket);
+      assertNull(storage.get(bucket.getName(), blob));
     }
   }
 
   @Test
   public void testSetObjectMetadata() {
-    SetObjectMetadata.setObjectMetadata(PROJECT_ID, BUCKET, BLOB);
-    Map<String, String> metadata = storage.get(BUCKET, BLOB).getMetadata();
-    assertEquals("value", metadata.get("keyToAddOrUpdate"));
+    String bucketName = bucket.getName();
+    String name1 = generator.randomObjectName();
+    BlobInfo b1Gen1 = storage.create(BlobInfo.newBuilder(bucketName, name1).build());
+
+    SetObjectMetadata.setObjectMetadata(GOOGLE_CLOUD_PROJECT, bucket.getName(), name1);
+    BlobInfo b1Gen2 = storage.get(bucketName, name1);
+    assertThat(b1Gen2).isNotNull();
+    assertThat(b1Gen2.getMetadata()).containsAtLeast("keyToAddOrUpdate", "value");
   }
 
   @Test
   public void testUploadObject() throws IOException {
-    File tempFile = File.createTempFile("file", ".txt");
-    try {
-      Files.write(tempFile.toPath(), CONTENT);
-      UploadObject.uploadObject(PROJECT_ID, BUCKET, "uploadobjecttest", tempFile.getPath());
-      assertArrayEquals(CONTENT, storage.get(BUCKET, "uploadobjecttest").getContent());
-    } finally {
-      tempFile.delete();
+    Path baseDir = tmpDir.getRoot().toPath();
+    try (TmpFile file1 = DataGenerator.base64Characters().tempFile(baseDir, 13)) {
+      String objectName = generator.randomObjectName();
+      UploadObject.uploadObject(
+          GOOGLE_CLOUD_PROJECT, bucket.getName(), objectName, file1.getPath().toString());
+      byte[] expected = Files.readAllBytes(file1.getPath());
+      byte[] actual = storage.readAllBytes(bucket.getName(), objectName);
+      assertArrayEquals(expected, actual);
     }
   }
 
   @Test
   public void testUploadObjectFromMemory() throws IOException {
+    String objectName = "uploadobjectfrommemorytest";
     UploadObjectFromMemory.uploadObjectFromMemory(
-        PROJECT_ID, BUCKET, "uploadobjectfrommemorytest", STRING_CONTENT);
-    final byte[] output = storage.get(BUCKET, "uploadobjectfrommemorytest").getContent();
+        GOOGLE_CLOUD_PROJECT, bucket.getName(), objectName, STRING_CONTENT);
+    final byte[] output = storage.get(bucket.getName(), objectName).getContent();
     assertEquals(STRING_CONTENT, new String(output, UTF_8));
   }
 
   @Test
   public void testObjectCSEKOperations() throws IOException {
     GenerateEncryptionKey.generateEncryptionKey();
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
+    String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
     String encryptionKey = snippetOutput.split(": ")[1].trim();
 
-    File tempFile = File.createTempFile("file", ".txt");
-    File downloadFile = File.createTempFile("dlfile", ".txt");
+    File tempFile = tmpDir.newFile("file.txt");
+    File downloadFile = tmpDir.newFile("dlfile.txt");
     String encryptedBlob = "uploadencryptedobjecttest";
     Files.write(tempFile.toPath(), CONTENT);
 
     UploadEncryptedObject.uploadEncryptedObject(
-        PROJECT_ID, BUCKET, encryptedBlob, tempFile.getPath(), encryptionKey);
+        GOOGLE_CLOUD_PROJECT, bucket.getName(), encryptedBlob, tempFile.getPath(), encryptionKey);
     DownloadEncryptedObject.downloadEncryptedObject(
-        PROJECT_ID, BUCKET, encryptedBlob, downloadFile.toPath(), encryptionKey);
+        GOOGLE_CLOUD_PROJECT,
+        bucket.getName(),
+        encryptedBlob,
+        downloadFile.toPath(),
+        encryptionKey);
     assertArrayEquals(CONTENT, Files.readAllBytes(downloadFile.toPath()));
 
     byte[] key = new byte[32];
     new Random().nextBytes(key);
     String newEncryptionKey = BaseEncoding.base64().encode(key);
     RotateObjectEncryptionKey.rotateObjectEncryptionKey(
-        PROJECT_ID, BUCKET, encryptedBlob, encryptionKey, newEncryptionKey);
-    File newDownloadFile = File.createTempFile("newdownloadfile", ".txt");
+        GOOGLE_CLOUD_PROJECT, bucket.getName(), encryptedBlob, encryptionKey, newEncryptionKey);
+    File newDownloadFile = tmpDir.newFile("newdownloadfile.txt");
     DownloadEncryptedObject.downloadEncryptedObject(
-        PROJECT_ID, BUCKET, encryptedBlob, newDownloadFile.toPath(), newEncryptionKey);
+        GOOGLE_CLOUD_PROJECT,
+        bucket.getName(),
+        encryptedBlob,
+        newDownloadFile.toPath(),
+        newEncryptionKey);
     assertArrayEquals(CONTENT, Files.readAllBytes(newDownloadFile.toPath()));
 
-    assertNull(storage.get(BUCKET, encryptedBlob).getKmsKeyName());
+    assertNull(storage.get(bucket.getName(), encryptedBlob).getKmsKeyName());
+    CryptoKey key1 = kmsFixture.getKey1();
     ChangeObjectCsekToKms.changeObjectFromCsekToKms(
-        PROJECT_ID, BUCKET, encryptedBlob, newEncryptionKey, KMS_KEY_NAME);
-    assertTrue(storage.get(BUCKET, encryptedBlob).getKmsKeyName().contains(KMS_KEY_NAME));
+        GOOGLE_CLOUD_PROJECT,
+        bucket.getName(),
+        encryptedBlob,
+        newEncryptionKey,
+        key1.getName());
+    assertTrue(
+        storage
+            .get(bucket.getName(), encryptedBlob)
+            .getKmsKeyName()
+            .contains(key1. getName()));
   }
 
   @Test
-  public void testObjectVersioningOperations() {
-    storage.get(BUCKET).toBuilder().setVersioningEnabled(true).build().update();
-    String versionedBlob = "versionedblob";
-    final Blob originalBlob =
-        storage.create(BlobInfo.newBuilder(BUCKET, versionedBlob).build(), CONTENT);
-    byte[] content2 = "Hello, World 2".getBytes(UTF_8);
-    storage.create(BlobInfo.newBuilder(BUCKET, versionedBlob).build(), content2);
-
-    ListObjectsWithOldVersions.listObjectsWithOldVersions(PROJECT_ID, BUCKET);
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
-
-    snippetOutput = snippetOutput.replaceFirst(versionedBlob, "");
-    assertTrue(snippetOutput.contains(versionedBlob));
-
-    CopyOldVersionOfObject.copyOldVersionOfObject(
-        PROJECT_ID, BUCKET, versionedBlob, originalBlob.getGeneration(), "copiedblob");
-    assertArrayEquals(CONTENT, storage.get(BUCKET, "copiedblob").getContent());
-
-    DeleteOldVersionOfObject.deleteOldVersionOfObject(
-        PROJECT_ID, BUCKET, versionedBlob, originalBlob.getGeneration());
-    assertNull(storage.get(BlobId.of(BUCKET, versionedBlob, originalBlob.getGeneration())));
-    assertNotNull(storage.get(BUCKET, versionedBlob));
+  public void testObjectVersioningOperations() throws Exception {
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName())
+            .setVersioningEnabled(true).build())
+        .setStorage(storage)
+        .build()) {
+      String bucketName = tmpBucket.getBucket().getName();
+
+      String versionedBlob = generator.randomObjectName();
+      final Blob originalBlob =
+          storage.create(BlobInfo.newBuilder(bucketName, versionedBlob).build(), CONTENT);
+      byte[] content2 = "Hello, World 2".getBytes(UTF_8);
+      storage.create(BlobInfo.newBuilder(bucketName, versionedBlob).build(), content2);
+
+      ListObjectsWithOldVersions.listObjectsWithOldVersions(GOOGLE_CLOUD_PROJECT, bucketName);
+      String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
+
+      snippetOutput = snippetOutput.replaceFirst(versionedBlob, "");
+      assertTrue(snippetOutput.contains(versionedBlob));
+
+      String copiedblob = generator.randomObjectName();
+      CopyOldVersionOfObject.copyOldVersionOfObject(
+          GOOGLE_CLOUD_PROJECT,
+          bucketName,
+          versionedBlob,
+          originalBlob.getGeneration(),
+          copiedblob);
+      assertArrayEquals(CONTENT, storage.get(bucketName, copiedblob).getContent());
+
+      DeleteOldVersionOfObject.deleteOldVersionOfObject(
+          GOOGLE_CLOUD_PROJECT, bucketName, versionedBlob, originalBlob.getGeneration());
+      assertNull(
+          storage.get(BlobId.of(bucketName, versionedBlob, originalBlob.getGeneration())));
+      assertNotNull(storage.get(bucketName, versionedBlob));
+    }
   }
 
   @Test
   public void testV4SignedURLs() throws IOException {
     String tempObject = "test-upload-signed-url-object";
-    GenerateV4PutObjectSignedUrl.generateV4PutObjectSignedUrl(PROJECT_ID, BUCKET, tempObject);
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
+    GenerateV4PutObjectSignedUrl.generateV4PutObjectSignedUrl(
+        GOOGLE_CLOUD_PROJECT, bucket.getName(), tempObject);
+    String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
     String url = snippetOutput.split("\n")[1];
     URL uploadUrl = new URL(url);
     HttpsURLConnection connection = (HttpsURLConnection) uploadUrl.openConnection();
@@ -366,8 +409,9 @@ public class ITObjectSnippets {
       out.write(CONTENT);
       assertEquals(connection.getResponseCode(), 200);
     }
-    GenerateV4GetObjectSignedUrl.generateV4GetObjectSignedUrl(PROJECT_ID, BUCKET, tempObject);
-    snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
+    GenerateV4GetObjectSignedUrl.generateV4GetObjectSignedUrl(
+        GOOGLE_CLOUD_PROJECT, bucket.getName(), tempObject);
+    snippetOutput = stdOut.getCapturedOutputAsUtf8String();
     url = snippetOutput.split("\n")[5];
     URL downloadUrl = new URL(url);
     connection = (HttpsURLConnection) downloadUrl.openConnection();
@@ -380,159 +424,187 @@ public class ITObjectSnippets {
 
   @Test
   public void testMakeObjectPublic() {
-    String aclBlob = "acl-test-blob";
+    String aclBlob = generator.randomObjectName();
     assertNull(
-        storage.create(BlobInfo.newBuilder(BUCKET, aclBlob).build()).getAcl(Acl.User.ofAllUsers()));
-    MakeObjectPublic.makeObjectPublic(PROJECT_ID, BUCKET, aclBlob);
-    assertNotNull(storage.get(BUCKET, aclBlob).getAcl(Acl.User.ofAllUsers()));
+        storage
+            .create(BlobInfo.newBuilder(bucket.getName(), aclBlob).build())
+            .getAcl(Acl.User.ofAllUsers()));
+    MakeObjectPublic.makeObjectPublic(GOOGLE_CLOUD_PROJECT, bucket.getName(), aclBlob);
+    assertNotNull(storage.get(bucket.getName(), aclBlob).getAcl(Acl.User.ofAllUsers()));
   }
 
   @Test
   public void testComposeObject() {
-    String firstObject = "firstObject";
-    String secondObject = "secondObject";
-    String targetObject = "targetObject";
-    storage.create(BlobInfo.newBuilder(BUCKET, firstObject).build(), firstObject.getBytes(UTF_8));
-    storage.create(BlobInfo.newBuilder(BUCKET, secondObject).build(), secondObject.getBytes(UTF_8));
+    String firstObject = generator.randomObjectName();
+    String secondObject = generator.randomObjectName();
+    String targetObject = generator.randomObjectName();
+    storage.create(
+        BlobInfo.newBuilder(bucket.getName(), firstObject).build(), firstObject.getBytes(UTF_8));
+    storage.create(
+        BlobInfo.newBuilder(bucket.getName(), secondObject).build(), secondObject.getBytes(UTF_8));
 
-    ComposeObject.composeObject(BUCKET, firstObject, secondObject, targetObject, PROJECT_ID);
+    ComposeObject.composeObject(
+        bucket.getName(), firstObject, secondObject, targetObject, GOOGLE_CLOUD_PROJECT);
 
-    assertArrayEquals(
-        "firstObjectsecondObject".getBytes(UTF_8), storage.get(BUCKET, targetObject).getContent());
+    String got = stdOut.getCapturedOutputAsUtf8String();
+    assertThat(got).contains(firstObject);
+    assertThat(got).contains(secondObject);
+    assertThat(got).contains(targetObject);
   }
 
   @Test
   public void testStreamUploadDownload() throws Exception {
-    StreamObjectUpload.streamObjectUpload(PROJECT_ID, BUCKET, "streamBlob", "hello world");
-    File file = File.createTempFile("stream", "test");
+    String blobName = generator.randomObjectName();
+    StreamObjectUpload.streamObjectUpload(
+        GOOGLE_CLOUD_PROJECT, bucket.getName(), blobName, "hello world");
+    String got1 = stdOut.getCapturedOutputAsUtf8String();
+    assertThat(got1).contains(blobName);
+    assertThat(got1).contains("WriteChannel");
+
+    File file = tmpDir.newFile();
     StreamObjectDownload.streamObjectDownload(
-        PROJECT_ID, BUCKET, "streamBlob", file.getAbsolutePath());
-    assertArrayEquals(Files.readAllBytes(file.toPath()), "hello world".getBytes());
-    file.delete();
+        GOOGLE_CLOUD_PROJECT, bucket.getName(), blobName, file.getAbsolutePath());
+    String got2 = stdOut.getCapturedOutputAsUtf8String();
+    assertThat(got2).contains(blobName);
+    assertThat(got2).contains("ReadChannel");
   }
 
   @Test
   public void testUploadKMSEncryptedObject() {
-    String blobName = "kms-encrypted-blob";
-    UploadKmsEncryptedObject.uploadKmsEncryptedObject(PROJECT_ID, BUCKET, blobName, KMS_KEY_NAME);
-    assertNotNull(storage.get(BUCKET, blobName));
+    String blobName = generator.randomObjectName();
+    UploadKmsEncryptedObject.uploadKmsEncryptedObject(
+        GOOGLE_CLOUD_PROJECT, bucket.getName(), blobName, kmsFixture.getKey1().getName());
+    assertNotNull(storage.get(bucket.getName(), blobName));
   }
 
   @Test
   public void testBatchSetObjectMetadata() {
-    storage.create(BlobInfo.newBuilder(BUCKET, "b/1.txt").build());
-    storage.create(BlobInfo.newBuilder(BUCKET, "b/2.txt").build());
-
-    BatchSetObjectMetadata.batchSetObjectMetadata(PROJECT_ID, BUCKET, "b/");
-
-    Map<String, String> firstBlobMetadata = storage.get(BUCKET, "b/1.txt").getMetadata();
-    Map<String, String> secondBlobMetadata = storage.get(BUCKET, "b/2.txt").getMetadata();
-
-    assertEquals("value", firstBlobMetadata.get("keyToAddOrUpdate"));
-    assertEquals("value", secondBlobMetadata.get("keyToAddOrUpdate"));
+    String prefix = generator.randomObjectName();
+    String name1 = prefix + "/1.txt";
+    String name2 = prefix + "/2.txt";
+    String bucketName = bucket.getName();
+    BlobInfo b1Gen1 = storage.create(BlobInfo.newBuilder(bucketName, name1).build());
+    BlobInfo b2Gen1 = storage.create(BlobInfo.newBuilder(bucketName, name2).build());
+
+    BatchSetObjectMetadata.batchSetObjectMetadata(GOOGLE_CLOUD_PROJECT, bucketName, prefix + "/");
+
+    BlobInfo b1Gen2 = storage.get(bucketName, name1);
+    BlobInfo b2Gen2 = storage.get(bucketName, name2);
+    assertThat(b1Gen2).isNotNull();
+    assertThat(b2Gen2).isNotNull();
+    assertThat(b1Gen2.getMetadata()).containsAtLeast("keyToAddOrUpdate", "value");
+    assertThat(b2Gen2.getMetadata()).containsAtLeast("keyToAddOrUpdate", "value");
   }
 
   @Test
   public void testSetObjectRetentionPolicy() {
-    String tempBucket = RemoteStorageHelper.generateBucketName();
-    storage.create(
-        BucketInfo.of(tempBucket), Storage.BucketTargetOption.enableObjectRetention(true));
-    String retentionBlob = "retentionblob";
-    storage.create(BlobInfo.newBuilder(tempBucket, retentionBlob).build());
-    assertNull(storage.get(tempBucket, retentionBlob).getRetention());
+    BucketInfo bucketInfo = BucketInfo.newBuilder(generator.randomBucketName()).build();
+    Bucket tmpBucket = storage.create(bucketInfo, BucketTargetOption.enableObjectRetention(true));
+    String tempBucket = tmpBucket.getName();
     try {
-      SetObjectRetentionPolicy.setObjectRetentionPolicy(PROJECT_ID, tempBucket, retentionBlob);
-      assertNotNull(storage.get(tempBucket, retentionBlob).getRetention());
-    } finally {
 
-      storage.get(tempBucket, retentionBlob).toBuilder()
-          .setRetention(null)
-          .build()
-          .update(Storage.BlobTargetOption.overrideUnlockedRetention(true));
-      storage.delete(tempBucket, retentionBlob);
-      storage.delete(tempBucket);
+      String retentionBlob = generator.randomObjectName();
+      BlobInfo gen1 = storage.create(BlobInfo.newBuilder(tempBucket, retentionBlob).build());
+      assertNull(storage.get(tempBucket, retentionBlob).getRetention());
+      try {
+        SetObjectRetentionPolicy.setObjectRetentionPolicy(
+            GOOGLE_CLOUD_PROJECT, tempBucket, retentionBlob);
+        assertNotNull(storage.get(tempBucket, retentionBlob).getRetention());
+      } finally {
+        storage.update(
+            gen1.toBuilder().setRetention(null).build(),
+            BlobTargetOption.overrideUnlockedRetention(true));
+      }
+    } finally {
+      BucketCleaner.doCleanup(tempBucket, storage);
     }
   }
 
   @Test
-  public void testListSoftDeletedObjects() {
-    // This is already the default, but we set it here in case the default ever changes
-    storage.get(BUCKET).toBuilder()
-        .setSoftDeletePolicy(
-            BucketInfo.SoftDeletePolicy.newBuilder()
+  public void testListSoftDeletedObjects() throws Exception {
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName())
+            // This is already the default, but we set it here in case the default ever changes
+            .setSoftDeletePolicy(
+                BucketInfo.SoftDeletePolicy.newBuilder()
                 .setRetentionDuration(Duration.ofDays(7))
                 .build())
-        .build()
-        .update();
+            .build())
+        .setStorage(storage)
+        .build()) {
+      String bucketName = tmpBucket.getBucket().getName();
 
-    String blob = "softdelobj";
-    storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, blob)).build());
-    storage.delete(BlobId.of(BUCKET, blob));
+      String blob = generator.randomObjectName();
+      storage.create(BlobInfo.newBuilder(BlobId.of(bucketName, blob)).build());
+      storage.delete(BlobId.of(bucketName, blob));
 
-    ListSoftDeletedObjects.listSoftDeletedObjects(PROJECT_ID, BUCKET);
+      ListSoftDeletedObjects.listSoftDeletedObjects(GOOGLE_CLOUD_PROJECT, bucketName);
 
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
+      String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
 
-    assertTrue(snippetOutput.contains(blob));
+      assertTrue(snippetOutput.contains(blob));
+    }
   }
 
   @Test
-  public void testListSoftDeletedVersionsOfObject() {
-    // This is already the default, but we set it here in case the default ever changes
-    storage.get(BUCKET).toBuilder()
-        .setSoftDeletePolicy(
-            BucketInfo.SoftDeletePolicy.newBuilder()
-                .setRetentionDuration(Duration.ofDays(7))
-                .build())
-        .build()
-        .update();
-
-    System.out.println(storage.get(BUCKET).getSoftDeletePolicy().toString());
-
-    String blob = "softdelobj1";
-    storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, blob)).build());
-    storage.delete(BlobId.of(BUCKET, blob));
-
-    String blob2 = "softdelobj2";
-    storage.create(BlobInfo.newBuilder(BlobId.of(BUCKET, blob2)).build());
-    storage.delete(BlobId.of(BUCKET, blob2));
-
-    ListSoftDeletedVersionsOfObject.listSoftDeletedVersionOfObject(PROJECT_ID, BUCKET, blob);
-
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
-
-    assertTrue(snippetOutput.contains(blob));
-    assertFalse(snippetOutput.contains(blob2));
+  public void testListSoftDeletedVersionsOfObject() throws Exception {
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName())
+            // This is already the default, but we set it here in case the default ever changes
+            .setSoftDeletePolicy(
+                BucketInfo.SoftDeletePolicy.newBuilder()
+                    .setRetentionDuration(Duration.ofDays(7))
+                    .build())
+            .build())
+        .setStorage(storage)
+        .build()) {
+      String bucketName = tmpBucket.getBucket().getName();
+
+      System.out.println(storage.get(bucketName).getSoftDeletePolicy().toString());
+
+      String blob = generator.randomObjectName();
+      storage.create(BlobInfo.newBuilder(BlobId.of(bucketName, blob)).build());
+      storage.delete(BlobId.of(bucketName, blob));
+
+      String blob2 = generator.randomObjectName();
+      storage.create(BlobInfo.newBuilder(BlobId.of(bucketName, blob2)).build());
+      storage.delete(BlobId.of(bucketName, blob2));
+
+      ListSoftDeletedVersionsOfObject.listSoftDeletedVersionOfObject(
+          GOOGLE_CLOUD_PROJECT, bucketName, blob);
+
+      String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
+
+      assertTrue(snippetOutput.contains(blob));
+      assertFalse(snippetOutput.contains(blob2));
+    }
   }
 
   @Test
-  public void testRestoreSoftDeletedObject() {
-    String bucket = RemoteStorageHelper.generateBucketName();
-
-    storage.create(BucketInfo.of(bucket));
-    try {
-      // This is already the default, but we set it here in case the default ever changes
-      storage.get(bucket).toBuilder()
-          .setSoftDeletePolicy(
-              BucketInfo.SoftDeletePolicy.newBuilder()
-                  .setRetentionDuration(Duration.ofDays(7))
-                  .build())
-          .build()
-          .update();
-
-      String blob = "restorableobj";
-
-      long gen =
-          storage.create(BlobInfo.newBuilder(BlobId.of(bucket, blob)).build()).getGeneration();
-      storage.delete(BlobId.of(bucket, blob));
-
-      assertNull(storage.get(BlobId.of(bucket, blob)));
-
-      RestoreSoftDeletedObject.restoreSoftDeletedObject(PROJECT_ID, bucket, blob, gen);
-
-      assertNotNull(storage.get(BlobId.of(bucket, blob)));
-    } finally {
-      RemoteStorageHelper.forceDelete(storage, bucket);
+  public void testRestoreSoftDeletedObject() throws Exception {
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName())
+            // This is already the default, but we set it here in case the default ever changes
+            .setSoftDeletePolicy(
+                BucketInfo.SoftDeletePolicy.newBuilder()
+                    .setRetentionDuration(Duration.ofDays(7))
+                    .build())
+            .build())
+        .setStorage(storage)
+        .build()) {
+      String bucketName = tmpBucket.getBucket().getName();
+
+      String blob = generator.randomObjectName();
+
+      BlobInfo gen1 = storage.create(BlobInfo.newBuilder(BlobId.of(bucketName, blob)).build());
+      storage.delete(BlobId.of(bucketName, blob));
+
+      assertNull(storage.get(BlobId.of(bucketName, blob)));
+
+      RestoreSoftDeletedObject.restoreSoftDeletedObject(
+          GOOGLE_CLOUD_PROJECT, bucketName, blob, gen1.getGeneration());
+
+      assertNotNull(storage.get(BlobId.of(bucketName, blob)));
     }
   }
 }
diff --git a/samples/snippets/src/test/java/com/example/storage/ITStorageSnippets.java b/samples/snippets/src/test/java/com/example/storage/ITStorageSnippets.java
index a320372b..805eef2f 100644
--- a/samples/snippets/src/test/java/com/example/storage/ITStorageSnippets.java
+++ b/samples/snippets/src/test/java/com/example/storage/ITStorageSnippets.java
@@ -47,7 +47,7 @@ public class ITStorageSnippets {
   private static final Logger log = Logger.getLogger(ITStorageSnippets.class.getName());
   private static final String BUCKET = RemoteStorageHelper.generateBucketName();
   private static Storage storage;
-  private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
+  private static final String PROJECT_ID = Env.GOOGLE_CLOUD_PROJECT;
 
   @Rule public final StdOutCaptureRule stdOutCaptureRule = new StdOutCaptureRule();
 
diff --git a/samples/snippets/src/test/java/com/example/storage/QuickstartSampleIT.java b/samples/snippets/src/test/java/com/example/storage/QuickstartSampleIT.java
index f4d4512a..4450ab8f 100644
--- a/samples/snippets/src/test/java/com/example/storage/QuickstartSampleIT.java
+++ b/samples/snippets/src/test/java/com/example/storage/QuickstartSampleIT.java
@@ -18,37 +18,33 @@ package com.example.storage;
 
 import static com.google.common.truth.Truth.assertThat;
 
+import com.google.cloud.storage.Bucket;
 import com.google.cloud.storage.BucketInfo;
 import com.google.cloud.storage.Storage;
+import com.google.cloud.storage.Storage.BucketField;
+import com.google.cloud.storage.Storage.BucketGetOption;
 import com.google.cloud.storage.StorageOptions;
 import com.google.cloud.storage.it.BucketCleaner;
-import com.google.cloud.testing.junit4.StdOutCaptureRule;
 import com.google.storage.control.v2.StorageLayoutName;
-import java.util.UUID;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
 
 /** Tests for quickstart sample. */
-@RunWith(JUnit4.class)
 @SuppressWarnings("checkstyle:abbreviationaswordinname")
-public class QuickstartSampleIT {
-
-  @Rule public final StdOutCaptureRule stdOutCaptureRule = new StdOutCaptureRule();
+public class QuickstartSampleIT extends TestBase {
 
   private String bucketName;
 
   @Before
   public void setUp() {
-    bucketName = "java-storage-grpc-" + UUID.randomUUID();
+    bucketName = generator.randomBucketName();
   }
 
   @After
-  public void tearDown() throws Exception {
-    try (Storage storage = StorageOptions.getDefaultInstance().getService()) {
+  public void tearDown() {
+    Bucket bucket = storage.get(bucketName, BucketGetOption.fields(BucketField.NAME));
+    if (bucket != null) {
       BucketCleaner.doCleanup(bucketName, storage);
     }
   }
@@ -56,21 +52,21 @@ public class QuickstartSampleIT {
   @Test
   public void testQuickstart() throws Exception {
     QuickstartSample.main(bucketName);
-    String got = stdOutCaptureRule.getCapturedOutputAsUtf8String();
+    String got = stdOut.getCapturedOutputAsUtf8String();
     assertThat(got).contains(String.format("Bucket %s created.", bucketName));
   }
 
   @Test
   public void testQuickstartGrpc() throws Exception {
     QuickstartGrpcSample.main(bucketName);
-    String got = stdOutCaptureRule.getCapturedOutputAsUtf8String();
+    String got = stdOut.getCapturedOutputAsUtf8String();
     assertThat(got).contains(String.format("Bucket %s created.", bucketName));
   }
 
   @Test
   public void testQuickstartGrpcDp() throws Exception {
     QuickstartGrpcDpSample.main(bucketName);
-    String got = stdOutCaptureRule.getCapturedOutputAsUtf8String();
+    String got = stdOut.getCapturedOutputAsUtf8String();
     assertThat(got).contains(String.format("Bucket %s created.", bucketName));
   }
 
@@ -79,7 +75,7 @@ public class QuickstartSampleIT {
     Storage storageClient = StorageOptions.getDefaultInstance().getService();
     storageClient.create(BucketInfo.of(bucketName));
     QuickstartStorageControlSample.main(bucketName);
-    String got = stdOutCaptureRule.getCapturedOutputAsUtf8String();
+    String got = stdOut.getCapturedOutputAsUtf8String();
     assertThat(got)
         .contains(
             String.format(
@@ -90,7 +86,7 @@ public class QuickstartSampleIT {
   @Test
   public void testQuickstartOpenTelemetry() throws Exception {
     QuickstartOpenTelemetrySample.main();
-    String got = stdOutCaptureRule.getCapturedOutputAsUtf8String();
+    String got = stdOut.getCapturedOutputAsUtf8String();
     assertThat(got).contains("Created an instance of storage with OpenTelemetry configured");
   }
 }
diff --git a/samples/snippets/src/test/java/com/example/storage/TestBase.java b/samples/snippets/src/test/java/com/example/storage/TestBase.java
index 1e314a74..298225c4 100644
--- a/samples/snippets/src/test/java/com/example/storage/TestBase.java
+++ b/samples/snippets/src/test/java/com/example/storage/TestBase.java
@@ -16,40 +16,39 @@
 
 package com.example.storage;
 
-import com.google.cloud.storage.Blob;
 import com.google.cloud.storage.BlobInfo;
-import com.google.cloud.storage.Bucket;
 import com.google.cloud.storage.BucketInfo;
 import com.google.cloud.storage.Storage;
-import com.google.cloud.storage.StorageOptions;
-import com.google.cloud.storage.it.BucketCleaner;
-import com.google.cloud.storage.testing.RemoteStorageHelper;
+import com.google.cloud.storage.Storage.BlobTargetOption;
+import com.google.cloud.storage.TransportCompatibility.Transport;
+import com.google.cloud.storage.it.runner.StorageITRunner;
+import com.google.cloud.storage.it.runner.annotations.Backend;
+import com.google.cloud.storage.it.runner.annotations.Inject;
+import com.google.cloud.storage.it.runner.annotations.SingleBackend;
+import com.google.cloud.storage.it.runner.annotations.StorageFixture;
+import com.google.cloud.storage.it.runner.registry.Generator;
 import com.google.cloud.testing.junit4.StdOutCaptureRule;
-import org.junit.After;
-import org.junit.Before;
+import org.checkerframework.checker.nullness.qual.NonNull;
 import org.junit.Rule;
+import org.junit.runner.RunWith;
 
+@RunWith(StorageITRunner.class)
+@SingleBackend(Backend.PROD)
 public abstract class TestBase {
 
   @Rule public StdOutCaptureRule stdOut = new StdOutCaptureRule();
 
-  protected String bucketName;
-  protected Storage storage;
-  protected String blobName;
-  protected Bucket bucket;
-  protected Blob blob;
+  @Inject
+  @StorageFixture(Transport.HTTP)
+  public Storage storage;
+  @Inject public BucketInfo bucket;
+  @Inject public Generator generator;
 
-  @Before
-  public void setUp() {
-    blobName = "blob";
-    bucketName = RemoteStorageHelper.generateBucketName();
-    storage = StorageOptions.getDefaultInstance().getService();
-    bucket = storage.create(BucketInfo.of(bucketName));
-    blob = storage.create(BlobInfo.newBuilder(bucketName, blobName).build());
+  protected BlobInfo info(@NonNull String name) {
+    return BlobInfo.newBuilder(bucket, name).build();
   }
 
-  @After
-  public void tearDown() {
-    BucketCleaner.doCleanup(bucketName, storage);
+  protected BlobInfo createEmptyObject() {
+    return storage.create(info(generator.randomObjectName()), BlobTargetOption.doesNotExist());
   }
 }
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketDefaultOwnerTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketDefaultOwnerTest.java
index 8dbb1786..f49ba1e8 100644
--- a/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketDefaultOwnerTest.java
+++ b/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketDefaultOwnerTest.java
@@ -16,24 +16,31 @@
 
 package com.example.storage.bucket;
 
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_EMAIL;
 import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
+import static com.google.common.truth.Truth.assertWithMessage;
 
 import com.example.storage.TestBase;
-import com.google.cloud.storage.Acl.User;
+import com.google.cloud.storage.BucketInfo;
+import com.google.cloud.storage.it.TemporaryBucket;
 import org.junit.Test;
 
 public class AddBucketDefaultOwnerTest extends TestBase {
 
-  public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL");
-
   @Test
-  public void testAddBucketDefaultOwner() {
+  public void testAddBucketDefaultOwner() throws Exception {
     // Check for user email before the actual test.
-    assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL);
+    assertWithMessage("Unable to determine user email").that(IT_SERVICE_ACCOUNT_EMAIL).isNotEmpty();
+
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName()).build())
+        .setStorage(storage)
+        .build()) {
+
+      String bucketName = tmpBucket.getBucket().getName();
 
-    AddBucketDefaultOwner.addBucketDefaultOwner(bucketName, IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(bucket.getDefaultAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNotNull();
+      AddBucketDefaultOwner.addBucketDefaultOwner(bucketName, IT_SERVICE_ACCOUNT_EMAIL);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
+    }
   }
 }
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketOwnerTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketOwnerTest.java
index 77c72242..e35c5a90 100644
--- a/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketOwnerTest.java
+++ b/samples/snippets/src/test/java/com/example/storage/bucket/AddBucketOwnerTest.java
@@ -16,25 +16,32 @@
 
 package com.example.storage.bucket;
 
+import static com.example.storage.Env.GOOGLE_CLOUD_PROJECT;
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_EMAIL;
 import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
+import static com.google.common.truth.Truth.assertWithMessage;
 
 import com.example.storage.TestBase;
-import com.google.cloud.storage.Acl.User;
+import com.google.cloud.storage.BucketInfo;
+import com.google.cloud.storage.it.TemporaryBucket;
 import org.junit.Test;
 
 public class AddBucketOwnerTest extends TestBase {
 
-  public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL");
-
   @Test
-  public void testAddBucketOwner() {
+  public void testAddBucketOwner() throws Exception {
     // Check for user email before the actual test.
-    assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL);
+    assertWithMessage("Unable to determine user email").that(IT_SERVICE_ACCOUNT_EMAIL).isNotEmpty();
+
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName()).build())
+        .setStorage(storage)
+        .build()) {
+
+      String bucketName = tmpBucket.getBucket().getName();
 
-    AddBucketOwner.addBucketOwner(
-        System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName, IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(bucket.getAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNotNull();
+      AddBucketOwner.addBucketOwner(GOOGLE_CLOUD_PROJECT, bucketName, IT_SERVICE_ACCOUNT_EMAIL);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
+    }
   }
 }
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/AutoclassTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/AutoclassTest.java
index 82297c69..aa39aae8 100644
--- a/samples/snippets/src/test/java/com/example/storage/bucket/AutoclassTest.java
+++ b/samples/snippets/src/test/java/com/example/storage/bucket/AutoclassTest.java
@@ -16,6 +16,7 @@
 
 package com.example.storage.bucket;
 
+import static com.example.storage.Env.GOOGLE_CLOUD_PROJECT;
 import static com.google.common.truth.Truth.assertThat;
 
 import com.example.storage.TestBase;
@@ -27,8 +28,6 @@ import org.junit.Test;
 
 public class AutoclassTest extends TestBase {
 
-  private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
-
   @Test
   public void testSetGetBucketAutoclass() throws Exception {
     String autoclassBucket = RemoteStorageHelper.generateBucketName();
@@ -37,11 +36,12 @@ public class AutoclassTest extends TestBase {
             .setAutoclass(Autoclass.newBuilder().setEnabled(true).build())
             .build());
     try {
-      SetBucketAutoclass.setBucketAutoclass(PROJECT_ID, autoclassBucket, StorageClass.NEARLINE);
+      SetBucketAutoclass.setBucketAutoclass(
+          GOOGLE_CLOUD_PROJECT, autoclassBucket, StorageClass.NEARLINE);
       Autoclass autoclass = storage.get(autoclassBucket).getAutoclass();
       assertThat(autoclass.getEnabled()).isTrue();
 
-      GetBucketAutoclass.getBucketAutoclass(PROJECT_ID, autoclassBucket);
+      GetBucketAutoclass.getBucketAutoclass(GOOGLE_CLOUD_PROJECT, autoclassBucket);
       assertThat(stdOut.getCapturedOutputAsUtf8String())
           .contains(autoclass.getToggleTime().toString());
     } finally {
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/CreateBucketDualRegionTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/CreateBucketDualRegionTest.java
index d4910c67..9b1ce9c7 100644
--- a/samples/snippets/src/test/java/com/example/storage/bucket/CreateBucketDualRegionTest.java
+++ b/samples/snippets/src/test/java/com/example/storage/bucket/CreateBucketDualRegionTest.java
@@ -16,6 +16,7 @@
 
 package com.example.storage.bucket;
 
+import static com.example.storage.Env.GOOGLE_CLOUD_PROJECT;
 import static com.google.common.truth.Truth.assertThat;
 import static org.junit.Assert.assertNotNull;
 
@@ -25,14 +26,12 @@ import org.junit.Test;
 
 public class CreateBucketDualRegionTest extends TestBase {
 
-  private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
-
   @Test
   public void testCreateBucketDualRegion() {
-    assertNotNull("Unable to determine Project ID", PROJECT_ID);
+    assertNotNull("Unable to determine Project ID", GOOGLE_CLOUD_PROJECT);
     String newBucket = RemoteStorageHelper.generateBucketName();
     CreateBucketDualRegion.createBucketDualRegion(
-        PROJECT_ID, newBucket, "US", "US-EAST1", "US-WEST1");
+        GOOGLE_CLOUD_PROJECT, newBucket, "US", "US-EAST1", "US-WEST1");
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("US-WEST1");
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("US-EAST1");
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("Created bucket");
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/CreateBucketPubSubNotificationTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/CreateBucketPubSubNotificationTest.java
deleted file mode 100644
index 7bfd9524..00000000
--- a/samples/snippets/src/test/java/com/example/storage/bucket/CreateBucketPubSubNotificationTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.storage.bucket;
-
-import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
-
-import com.example.storage.TestBase;
-import com.google.cloud.pubsub.v1.TopicAdminClient;
-import com.google.cloud.storage.Notification;
-import com.google.cloud.storage.NotificationInfo.EventType;
-import com.google.common.collect.ImmutableMap;
-import com.google.iam.v1.Binding;
-import com.google.iam.v1.GetIamPolicyRequest;
-import com.google.iam.v1.SetIamPolicyRequest;
-import java.io.IOException;
-import java.util.Map;
-import java.util.UUID;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class CreateBucketPubSubNotificationTest extends TestBase {
-
-  private static final Notification.PayloadFormat PAYLOAD_FORMAT =
-      Notification.PayloadFormat.JSON_API_V1.JSON_API_V1;
-  private static final Map<String, String> CUSTOM_ATTRIBUTES = ImmutableMap.of("label1", "value1");
-  private static final String PROJECT = System.getenv("GOOGLE_CLOUD_PROJECT");
-  private static final String PROJECT_NUMBER = System.getenv("GOOGLE_CLOUD_PROJECT_NUMBER");
-
-  private static final String ID = UUID.randomUUID().toString().substring(0, 8);
-  private static final String TOPIC =
-      String.format("projects/%s/topics/new-topic-create-%s", PROJECT, ID);
-  private static final String OBJECT_NAME_PREFIX = "index.html";
-  private static final EventType[] EVENT_TYPES = {
-    EventType.OBJECT_FINALIZE, EventType.OBJECT_METADATA_UPDATE
-  };
-  private static TopicAdminClient topicAdminClient;
-
-  @BeforeClass
-  public static void configureTopicAdminClient() throws IOException {
-    if (PROJECT != null) {
-      topicAdminClient = TopicAdminClient.create();
-      topicAdminClient.createTopic(TOPIC);
-      GetIamPolicyRequest getIamPolicyRequest =
-          GetIamPolicyRequest.newBuilder().setResource(TOPIC).build();
-      com.google.iam.v1.Policy policy = topicAdminClient.getIamPolicy(getIamPolicyRequest);
-      // For available bindings identities, see
-      // https://cloud.google.com/iam/docs/overview#concepts_related_identity
-      String member =
-          PROJECT_NUMBER != null
-              ? "serviceAccount:service-"
-                  + PROJECT_NUMBER
-                  + "@gs-project-accounts.iam.gserviceaccount.com"
-              : "allAuthenticatedUsers";
-      Binding binding = Binding.newBuilder().setRole("roles/owner").addMembers(member).build();
-      SetIamPolicyRequest setIamPolicyRequest =
-          SetIamPolicyRequest.newBuilder()
-              .setResource(TOPIC)
-              .setPolicy(policy.toBuilder().addBindings(binding).build())
-              .build();
-      topicAdminClient.setIamPolicy(setIamPolicyRequest);
-    }
-  }
-
-  @AfterClass
-  public static void deleteTopicAndClient() {
-    /* Delete the Pub/Sub topic */
-    if (topicAdminClient != null) {
-      topicAdminClient.deleteTopic(TOPIC);
-      topicAdminClient.close();
-    }
-  }
-
-  @Test
-  public void testCreateBucketPubSubNotification() {
-    // Check that we can access project value and that topic admin client came up successfully
-    assertNotNull("Unable to determine project", PROJECT);
-    assertNotNull("Topic Admin Client did not start up", topicAdminClient);
-
-    com.example.storage.bucket.CreateBucketPubSubNotification.createBucketPubSubNotification(
-        bucketName, TOPIC, CUSTOM_ATTRIBUTES, EVENT_TYPES, OBJECT_NAME_PREFIX, PAYLOAD_FORMAT);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(TOPIC);
-  }
-}
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/DeleteBucketPubSubNotificationTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/DeleteBucketPubSubNotificationTest.java
deleted file mode 100644
index aab1073b..00000000
--- a/samples/snippets/src/test/java/com/example/storage/bucket/DeleteBucketPubSubNotificationTest.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.storage.bucket;
-
-import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
-
-import com.example.storage.TestBase;
-import com.google.cloud.pubsub.v1.TopicAdminClient;
-import com.google.cloud.storage.Notification;
-import com.google.cloud.storage.NotificationInfo;
-import com.google.cloud.testing.junit4.MultipleAttemptsRule;
-import com.google.common.collect.ImmutableMap;
-import com.google.iam.v1.Binding;
-import com.google.iam.v1.GetIamPolicyRequest;
-import com.google.iam.v1.SetIamPolicyRequest;
-import java.io.IOException;
-import java.util.Map;
-import java.util.UUID;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-
-public class DeleteBucketPubSubNotificationTest extends TestBase {
-
-  @Rule public MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(5);
-
-  private static final Notification.PayloadFormat PAYLOAD_FORMAT =
-      Notification.PayloadFormat.JSON_API_V1.JSON_API_V1;
-  private static final Map<String, String> CUSTOM_ATTRIBUTES = ImmutableMap.of("label1", "value1");
-  private static final String PROJECT = System.getenv("GOOGLE_CLOUD_PROJECT");
-  private static final String PROJECT_NUMBER = System.getenv("GOOGLE_CLOUD_PROJECT_NUMBER");
-
-  private static final String ID = UUID.randomUUID().toString().substring(0, 8);
-  private static final String TOPIC =
-      String.format("projects/%s/topics/new-topic-delete-%s", PROJECT, ID);
-  private static TopicAdminClient topicAdminClient;
-  private static final NotificationInfo notificationInfo =
-      NotificationInfo.newBuilder(TOPIC)
-          .setCustomAttributes(CUSTOM_ATTRIBUTES)
-          .setPayloadFormat(PAYLOAD_FORMAT)
-          .build();
-
-  @BeforeClass
-  public static void configureTopicAdminClient() throws IOException {
-    if (PROJECT != null) {
-      topicAdminClient = TopicAdminClient.create();
-      topicAdminClient.createTopic(TOPIC);
-      GetIamPolicyRequest getIamPolicyRequest =
-          GetIamPolicyRequest.newBuilder().setResource(TOPIC).build();
-      com.google.iam.v1.Policy policy = topicAdminClient.getIamPolicy(getIamPolicyRequest);
-      // For available bindings identities, see
-      // https://cloud.google.com/iam/docs/overview#concepts_related_identity
-      String member =
-          PROJECT_NUMBER != null
-              ? "serviceAccount:service-"
-                  + PROJECT_NUMBER
-                  + "@gs-project-accounts.iam.gserviceaccount.com"
-              : "allAuthenticatedUsers";
-      Binding binding = Binding.newBuilder().setRole("roles/owner").addMembers(member).build();
-      SetIamPolicyRequest setIamPolicyRequest =
-          SetIamPolicyRequest.newBuilder()
-              .setResource(TOPIC)
-              .setPolicy(policy.toBuilder().addBindings(binding).build())
-              .build();
-      topicAdminClient.setIamPolicy(setIamPolicyRequest);
-    }
-  }
-
-  @AfterClass
-  public static void deleteTopicAndClient() {
-    /* Delete the Pub/Sub topic */
-    if (topicAdminClient != null) {
-      topicAdminClient.deleteTopic(TOPIC);
-      topicAdminClient.close();
-    }
-  }
-
-  @Test
-  public void testDeleteBucketPubSubNotification() {
-    // Check that we can access project value and that topic admin client came up successfully
-    assertNotNull("Unable to determine project", PROJECT);
-    assertNotNull("Topic Admin Client did not start up", topicAdminClient);
-
-    Notification notification = storage.createNotification(bucketName, notificationInfo);
-    com.example.storage.bucket.DeleteBucketPubSubNotification.deleteBucketPubSubNotification(
-        bucketName, notification.getNotificationId());
-    assertThat(stdOut.getCapturedOutputAsUtf8String())
-        .contains("Successfully deleted notification");
-  }
-
-  @Test
-  public void testNotificationNotFound() {
-    // Check that we can access project value and that topic admin client came up successfully
-    assertNotNull("Unable to determine project", PROJECT);
-    assertNotNull("Topic Admin Client did not start up", topicAdminClient);
-    Notification notification = storage.createNotification(bucketName, notificationInfo);
-    // Do a delete first.
-    storage.deleteNotification(bucketName, notification.getNotificationId());
-    // Now try to delete again.
-    com.example.storage.bucket.DeleteBucketPubSubNotification.deleteBucketPubSubNotification(
-        bucketName, notification.getNotificationId());
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("Failed to find notification");
-  }
-}
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/ListPubSubNotificationsTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/ListPubSubNotificationsTest.java
deleted file mode 100644
index 88a4613e..00000000
--- a/samples/snippets/src/test/java/com/example/storage/bucket/ListPubSubNotificationsTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.storage.bucket;
-
-import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
-
-import com.example.storage.TestBase;
-import com.google.cloud.pubsub.v1.TopicAdminClient;
-import com.google.cloud.storage.Notification;
-import com.google.cloud.storage.NotificationInfo;
-import com.google.cloud.testing.junit4.MultipleAttemptsRule;
-import com.google.common.collect.ImmutableMap;
-import com.google.iam.v1.Binding;
-import com.google.iam.v1.GetIamPolicyRequest;
-import com.google.iam.v1.SetIamPolicyRequest;
-import java.io.IOException;
-import java.util.Map;
-import java.util.UUID;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-
-public class ListPubSubNotificationsTest extends TestBase {
-
-  @Rule public MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(5);
-
-  private static final Notification.PayloadFormat PAYLOAD_FORMAT =
-      Notification.PayloadFormat.JSON_API_V1.JSON_API_V1;
-  private static final Map<String, String> CUSTOM_ATTRIBUTES = ImmutableMap.of("label1", "value1");
-  private static final String PROJECT = System.getenv("GOOGLE_CLOUD_PROJECT");
-  private static final String PROJECT_NUMBER = System.getenv("GOOGLE_CLOUD_PROJECT_NUMBER");
-
-  private static final String ID = UUID.randomUUID().toString().substring(0, 8);
-  private static final String TOPIC =
-      String.format("projects/%s/topics/new-topic-list-%s", PROJECT, ID);
-  private static TopicAdminClient topicAdminClient;
-
-  @BeforeClass
-  public static void configureTopicAdminClient() throws IOException {
-    if (PROJECT != null) {
-      topicAdminClient = TopicAdminClient.create();
-      topicAdminClient.createTopic(TOPIC);
-      GetIamPolicyRequest getIamPolicyRequest =
-          GetIamPolicyRequest.newBuilder().setResource(TOPIC).build();
-      com.google.iam.v1.Policy policy = topicAdminClient.getIamPolicy(getIamPolicyRequest);
-      // For available bindings identities, see
-      // https://cloud.google.com/iam/docs/overview#concepts_related_identity
-      String member =
-          PROJECT_NUMBER != null
-              ? "serviceAccount:service-"
-                  + PROJECT_NUMBER
-                  + "@gs-project-accounts.iam.gserviceaccount.com"
-              : "allAuthenticatedUsers";
-      Binding binding = Binding.newBuilder().setRole("roles/owner").addMembers(member).build();
-      SetIamPolicyRequest setIamPolicyRequest =
-          SetIamPolicyRequest.newBuilder()
-              .setResource(TOPIC)
-              .setPolicy(policy.toBuilder().addBindings(binding).build())
-              .build();
-      topicAdminClient.setIamPolicy(setIamPolicyRequest);
-    }
-  }
-
-  @AfterClass
-  public static void deleteTopicAndClient() {
-    /* Delete the Pub/Sub topic */
-    if (topicAdminClient != null) {
-      topicAdminClient.deleteTopic(TOPIC);
-      topicAdminClient.close();
-    }
-  }
-
-  @Test
-  public void testListBucketPubSubNotification() {
-    // Check that we can access project value and that topic admin client came up successfully
-    assertNotNull("Unable to determine project", PROJECT);
-    assertNotNull("Topic Admin Client did not start up", topicAdminClient);
-
-    NotificationInfo notificationInfo =
-        NotificationInfo.newBuilder(TOPIC)
-            .setCustomAttributes(CUSTOM_ATTRIBUTES)
-            .setPayloadFormat(PAYLOAD_FORMAT)
-            .build();
-    storage.createNotification(bucketName, notificationInfo);
-    ListPubSubNotifications.listPubSubNotifications(bucketName);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(TOPIC);
-  }
-}
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclFilterByUserTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclFilterByUserTest.java
deleted file mode 100644
index 95443a23..00000000
--- a/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclFilterByUserTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.storage.bucket;
-
-import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
-
-import com.example.storage.TestBase;
-import com.google.cloud.storage.Acl;
-import com.google.cloud.storage.Acl.Entity;
-import com.google.cloud.storage.Acl.Role;
-import com.google.cloud.storage.Acl.User;
-import org.junit.Test;
-
-public class PrintBucketAclFilterByUserTest extends TestBase {
-
-  public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL");
-
-  @Test
-  public void testPrintBucketAclByUser() {
-    // Check for user email before the actual test.
-    assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL);
-
-    Entity testUser = new User(IT_SERVICE_ACCOUNT_EMAIL);
-    storage.createAcl(bucketName, Acl.of(testUser, Role.READER));
-    PrintBucketAclFilterByUser.printBucketAclFilterByUser(bucketName, IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(Role.READER.name());
-  }
-}
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclTest.java
index 399cbe65..2fff1e8f 100644
--- a/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclTest.java
+++ b/samples/snippets/src/test/java/com/example/storage/bucket/PrintBucketAclTest.java
@@ -16,28 +16,53 @@
 
 package com.example.storage.bucket;
 
+import static com.example.storage.Env.GOOGLE_CLOUD_PROJECT;
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_EMAIL;
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_USER;
 import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
+import static com.google.common.truth.Truth.assertWithMessage;
 
 import com.example.storage.TestBase;
 import com.google.cloud.storage.Acl;
-import com.google.cloud.storage.Acl.Entity;
 import com.google.cloud.storage.Acl.Role;
-import com.google.cloud.storage.Acl.User;
+import com.google.cloud.storage.BucketInfo;
+import com.google.cloud.storage.it.TemporaryBucket;
 import org.junit.Test;
 
 public class PrintBucketAclTest extends TestBase {
 
-  public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL");
+  @Test
+  public void testPrintBucketAcls() throws Exception {
+    // Check for user email before the actual test.
+    assertWithMessage("Unable to determine user email").that(IT_SERVICE_ACCOUNT_EMAIL).isNotEmpty();
+
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName()).build())
+        .setStorage(storage)
+        .build()) {
+
+      String bucketName = tmpBucket.getBucket().getName();
+      storage.createAcl(bucketName, Acl.of(IT_SERVICE_ACCOUNT_USER, Role.READER));
+      PrintBucketAcl.printBucketAcl(GOOGLE_CLOUD_PROJECT, bucketName);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("READER: USER");
+    }
+  }
 
   @Test
-  public void testPrintBucketAcls() {
+  public void testPrintBucketAclByUser() throws Exception {
     // Check for user email before the actual test.
-    assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL);
+    assertWithMessage("Unable to determine user email").that(IT_SERVICE_ACCOUNT_EMAIL).isNotEmpty();
+
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName()).build())
+        .setStorage(storage)
+        .build()) {
 
-    Entity testUser = new User(IT_SERVICE_ACCOUNT_EMAIL);
-    storage.createAcl(bucketName, Acl.of(testUser, Role.READER));
-    PrintBucketAcl.printBucketAcl(System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("READER: USER");
+      String bucketName = tmpBucket.getBucket().getName();
+      storage.createAcl(bucketName, Acl.of(IT_SERVICE_ACCOUNT_USER, Role.READER));
+      PrintBucketAclFilterByUser.printBucketAclFilterByUser(bucketName, IT_SERVICE_ACCOUNT_EMAIL);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(Role.READER.name());
+    }
   }
 }
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/PrintPubSubNotificationTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/PrintPubSubNotificationTest.java
deleted file mode 100644
index d342795a..00000000
--- a/samples/snippets/src/test/java/com/example/storage/bucket/PrintPubSubNotificationTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright 2022 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.storage.bucket;
-
-import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
-
-import com.example.storage.TestBase;
-import com.google.cloud.pubsub.v1.TopicAdminClient;
-import com.google.cloud.storage.Notification;
-import com.google.cloud.storage.NotificationInfo;
-import com.google.common.collect.ImmutableMap;
-import com.google.iam.v1.Binding;
-import com.google.iam.v1.GetIamPolicyRequest;
-import com.google.iam.v1.SetIamPolicyRequest;
-import java.io.IOException;
-import java.util.Map;
-import java.util.UUID;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class PrintPubSubNotificationTest extends TestBase {
-
-  private static final Notification.PayloadFormat PAYLOAD_FORMAT =
-      Notification.PayloadFormat.JSON_API_V1.JSON_API_V1;
-  private static final Map<String, String> CUSTOM_ATTRIBUTES = ImmutableMap.of("label1", "value1");
-  private static final String PROJECT = System.getenv("GOOGLE_CLOUD_PROJECT");
-  private static final String PROJECT_NUMBER = System.getenv("GOOGLE_CLOUD_PROJECT_NUMBER");
-
-  private static final String ID = UUID.randomUUID().toString().substring(0, 8);
-  private static final String TOPIC =
-      String.format("projects/%s/topics/new-topic-print-%s", PROJECT, ID);
-  private static TopicAdminClient topicAdminClient;
-
-  @BeforeClass
-  public static void configureTopicAdminClient() throws IOException {
-    if (PROJECT != null) {
-      topicAdminClient = TopicAdminClient.create();
-      topicAdminClient.createTopic(TOPIC);
-      GetIamPolicyRequest getIamPolicyRequest =
-          GetIamPolicyRequest.newBuilder().setResource(TOPIC).build();
-      com.google.iam.v1.Policy policy = topicAdminClient.getIamPolicy(getIamPolicyRequest);
-      // For available bindings identities, see
-      // https://cloud.google.com/iam/docs/overview#concepts_related_identity
-      String member =
-          PROJECT_NUMBER != null
-              ? "serviceAccount:service-"
-                  + PROJECT_NUMBER
-                  + "@gs-project-accounts.iam.gserviceaccount.com"
-              : "allAuthenticatedUsers";
-      Binding binding = Binding.newBuilder().setRole("roles/owner").addMembers(member).build();
-      SetIamPolicyRequest setIamPolicyRequest =
-          SetIamPolicyRequest.newBuilder()
-              .setResource(TOPIC)
-              .setPolicy(policy.toBuilder().addBindings(binding).build())
-              .build();
-      topicAdminClient.setIamPolicy(setIamPolicyRequest);
-    }
-  }
-
-  @AfterClass
-  public static void deleteTopicAndClient() {
-    /* Delete the Pub/Sub topic */
-    if (topicAdminClient != null) {
-      topicAdminClient.deleteTopic(TOPIC);
-      topicAdminClient.close();
-    }
-  }
-
-  @Test
-  public void testPrintBucketPubSubNotification() {
-    // Check that we can access project value and that topic admin client came up successfully
-    assertNotNull("Unable to determine project", PROJECT);
-    assertNotNull("Topic Admin Client did not start up", topicAdminClient);
-
-    NotificationInfo notificationInfo =
-        NotificationInfo.newBuilder(TOPIC)
-            .setCustomAttributes(CUSTOM_ATTRIBUTES)
-            .setPayloadFormat(PAYLOAD_FORMAT)
-            .build();
-    Notification notification = storage.createNotification(bucketName, notificationInfo);
-    PrintPubSubNotification.printPubSubNotification(bucketName, notification.getNotificationId());
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(TOPIC);
-  }
-}
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/PubSubNotificationTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/PubSubNotificationTest.java
new file mode 100644
index 00000000..3cccbaa1
--- /dev/null
+++ b/samples/snippets/src/test/java/com/example/storage/bucket/PubSubNotificationTest.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.storage.bucket;
+
+import static com.example.storage.Env.GOOGLE_CLOUD_PROJECT;
+import static com.example.storage.Env.GOOGLE_CLOUD_PROJECT_NUMBER;
+import static com.google.common.truth.Truth.assertThat;
+
+import com.example.storage.TestBase;
+import com.google.cloud.pubsub.v1.TopicAdminClient;
+import com.google.cloud.storage.Notification;
+import com.google.cloud.storage.NotificationInfo;
+import com.google.cloud.storage.NotificationInfo.EventType;
+import com.google.common.collect.ImmutableMap;
+import com.google.iam.v1.Binding;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.SetIamPolicyRequest;
+import java.io.IOException;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class PubSubNotificationTest extends TestBase {
+
+  private static final Map<String, String> CUSTOM_ATTRIBUTES = ImmutableMap.of("label1", "value1");
+
+  private static final String OBJECT_NAME_PREFIX = "index.html";
+  private static final EventType[] EVENT_TYPES = {
+    EventType.OBJECT_FINALIZE, EventType.OBJECT_METADATA_UPDATE
+  };
+  private static TopicAdminClient topicAdminClient;
+
+  private String bucketName;
+  private String topic;
+  private NotificationInfo notificationInfo;
+
+  @BeforeClass
+  public static void configureTopicAdminClient() throws IOException {
+    topicAdminClient = TopicAdminClient.create();
+  }
+
+  @AfterClass
+  public static void deleteTopicAndClient() throws InterruptedException {
+    /* Delete the Pub/Sub topic */
+    if (topicAdminClient != null) {
+      topicAdminClient.shutdownNow();
+      topicAdminClient.awaitTermination(5, TimeUnit.SECONDS);
+    }
+  }
+
+  @Before
+  public void setUp() {
+    assertThat(GOOGLE_CLOUD_PROJECT).isNotNull();
+
+    bucketName = bucket.getName();
+
+    String id = UUID.randomUUID().toString().substring(0, 8);
+    topic = String.format("projects/%s/topics/new-topic-%s", GOOGLE_CLOUD_PROJECT, id);
+    topicAdminClient.createTopic(topic);
+    GetIamPolicyRequest getIamPolicyRequest =
+        GetIamPolicyRequest.newBuilder().setResource(topic).build();
+    com.google.iam.v1.Policy policy = topicAdminClient.getIamPolicy(getIamPolicyRequest);
+    // For available bindings identities, see
+    // https://cloud.google.com/iam/docs/overview#concepts_related_identity
+    String member =
+        GOOGLE_CLOUD_PROJECT_NUMBER != null
+            ? String.format(
+                "serviceAccount:service-%s@gs-project-accounts.iam.gserviceaccount.com",
+                GOOGLE_CLOUD_PROJECT_NUMBER)
+            : "allAuthenticatedUsers";
+    Binding binding = Binding.newBuilder().setRole("roles/owner").addMembers(member).build();
+    SetIamPolicyRequest setIamPolicyRequest =
+        SetIamPolicyRequest.newBuilder()
+            .setResource(topic)
+            .setPolicy(policy.toBuilder().addBindings(binding).build())
+            .build();
+    topicAdminClient.setIamPolicy(setIamPolicyRequest);
+
+    notificationInfo =
+        NotificationInfo.newBuilder(topic)
+            .setCustomAttributes(CUSTOM_ATTRIBUTES)
+            .setPayloadFormat(Notification.PayloadFormat.JSON_API_V1)
+            .build();
+  }
+
+  @After
+  public void tearDown() {
+    if (topic != null) {
+      topicAdminClient.deleteTopic(topic);
+    }
+  }
+
+  @Test
+  public void testCreateBucketPubSubNotification() {
+    CreateBucketPubSubNotification.createBucketPubSubNotification(
+        bucketName,
+        topic,
+        CUSTOM_ATTRIBUTES,
+        EVENT_TYPES,
+        OBJECT_NAME_PREFIX,
+        Notification.PayloadFormat.JSON_API_V1);
+    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(topic);
+  }
+
+  @Test
+  public void testDeleteBucketPubSubNotification() {
+    Notification notification = storage.createNotification(bucketName, notificationInfo);
+    DeleteBucketPubSubNotification.deleteBucketPubSubNotification(
+        bucketName, notification.getNotificationId());
+    assertThat(stdOut.getCapturedOutputAsUtf8String())
+        .contains("Successfully deleted notification");
+  }
+
+  @Test
+  public void testNotificationNotFound() {
+    Notification notification = storage.createNotification(bucketName, notificationInfo);
+    // Do a delete first.
+    storage.deleteNotification(bucketName, notification.getNotificationId());
+    // Now try to delete again.
+    DeleteBucketPubSubNotification.deleteBucketPubSubNotification(
+        bucketName, notification.getNotificationId());
+    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("Failed to find notification");
+  }
+
+  @Test
+  public void testListBucketPubSubNotification() {
+    storage.createNotification(bucketName, notificationInfo);
+    ListPubSubNotifications.listPubSubNotifications(bucketName);
+    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(topic);
+  }
+
+  @Test
+  public void testPrintBucketPubSubNotification() {
+    Notification notification = storage.createNotification(bucketName, notificationInfo);
+    PrintPubSubNotification.printPubSubNotification(bucketName, notification.getNotificationId());
+    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(topic);
+  }
+}
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketDefaultOwnerTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketDefaultOwnerTest.java
index 8af2f1ef..d5e8ad86 100644
--- a/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketDefaultOwnerTest.java
+++ b/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketDefaultOwnerTest.java
@@ -16,39 +16,54 @@
 
 package com.example.storage.bucket;
 
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_EMAIL;
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_USER;
 import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
+import static com.google.common.truth.Truth.assertWithMessage;
 
 import com.example.storage.TestBase;
 import com.google.cloud.storage.Acl;
 import com.google.cloud.storage.Acl.Role;
-import com.google.cloud.storage.Acl.User;
+import com.google.cloud.storage.BucketInfo;
+import com.google.cloud.storage.it.TemporaryBucket;
 import org.junit.Test;
 
 public class RemoveBucketDefaultOwnerTest extends TestBase {
 
-  public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL");
-
   @Test
-  public void testRemoveBucketDefaultOwner() {
+  public void testRemoveBucketDefaultOwner() throws Exception {
     // Check for user email before the actual test.
-    assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL);
-    // Add User as Default Owner
-    Acl newDefaultOwner = Acl.of(new User(IT_SERVICE_ACCOUNT_EMAIL), Role.OWNER);
-    bucket.createDefaultAcl(newDefaultOwner);
-
-    // Remove User as Default owner
-    RemoveBucketDefaultOwner.removeBucketDefaultOwner(bucketName, IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("Removed user");
-    assertThat(bucket.getDefaultAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNull();
+    assertWithMessage("Unable to determine user email").that(IT_SERVICE_ACCOUNT_EMAIL).isNotEmpty();
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName()).build())
+        .setStorage(storage)
+        .build()) {
+
+      String bucketName = tmpBucket.getBucket().getName();
+
+      // Add User as Default Owner
+      Acl newDefaultOwner = Acl.of(IT_SERVICE_ACCOUNT_USER, Role.OWNER);
+      storage.createDefaultAcl(bucketName, newDefaultOwner);
+
+      // Remove User as Default owner
+      RemoveBucketDefaultOwner.removeBucketDefaultOwner(bucketName, IT_SERVICE_ACCOUNT_EMAIL);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("Removed user");
+    }
   }
 
   @Test
-  public void testUserNotFound() {
-    // Remove User without Default Owner Permissions
-    RemoveBucketDefaultOwner.removeBucketDefaultOwner(bucketName, IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("was not found");
+  public void testUserNotFound() throws Exception {
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName()).build())
+        .setStorage(storage)
+        .build()) {
+
+      String bucketName = tmpBucket.getBucket().getName();
+      // Remove User without Default Owner Permissions
+      RemoveBucketDefaultOwner.removeBucketDefaultOwner(bucketName, IT_SERVICE_ACCOUNT_EMAIL);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("was not found");
+    }
   }
 }
diff --git a/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketOwnerTest.java b/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketOwnerTest.java
index add09380..2d0e7bb2 100644
--- a/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketOwnerTest.java
+++ b/samples/snippets/src/test/java/com/example/storage/bucket/RemoveBucketOwnerTest.java
@@ -16,41 +16,58 @@
 
 package com.example.storage.bucket;
 
+import static com.example.storage.Env.GOOGLE_CLOUD_PROJECT;
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_EMAIL;
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_USER;
 import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
+import static com.google.common.truth.Truth.assertWithMessage;
 
 import com.example.storage.TestBase;
 import com.google.cloud.storage.Acl;
 import com.google.cloud.storage.Acl.Role;
-import com.google.cloud.storage.Acl.User;
+import com.google.cloud.storage.BucketInfo;
+import com.google.cloud.storage.it.TemporaryBucket;
 import org.junit.Test;
 
 public class RemoveBucketOwnerTest extends TestBase {
 
-  public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL");
-
   @Test
-  public void testRemoveBucketOwner() {
+  public void testRemoveBucketOwner() throws Exception {
     // Check for user email before the actual test.
-    assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL);
-    // Add User as Owner
-    Acl newOwner = Acl.of(new User(IT_SERVICE_ACCOUNT_EMAIL), Role.OWNER);
-    bucket.createAcl(newOwner);
-
-    // Remove User as owner
-    RemoveBucketOwner.removeBucketOwner(
-        System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName, IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("Removed user");
-    assertThat(bucket.getAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNull();
+    assertWithMessage("Unable to determine user email").that(IT_SERVICE_ACCOUNT_EMAIL).isNotEmpty();
+
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName()).build())
+        .setStorage(storage)
+        .build()) {
+
+      String bucketName = tmpBucket.getBucket().getName();
+      // Add User as Owner
+      Acl newOwner = Acl.of(IT_SERVICE_ACCOUNT_USER, Role.OWNER);
+      storage.createAcl(bucketName, newOwner);
+
+      // Remove User as owner
+      RemoveBucketOwner.removeBucketOwner(
+          GOOGLE_CLOUD_PROJECT, bucketName, IT_SERVICE_ACCOUNT_EMAIL);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("Removed user");
+    }
   }
 
   @Test
-  public void testUserNotFound() {
-    // Remove User without Owner Permissions
-    RemoveBucketOwner.removeBucketOwner(
-        System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName, IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("was not found");
+  public void testUserNotFound() throws Exception {
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName()).build())
+        .setStorage(storage)
+        .build()) {
+
+      String bucketName = tmpBucket.getBucket().getName();
+
+      // Remove User without Owner Permissions
+      RemoveBucketOwner.removeBucketOwner(
+          GOOGLE_CLOUD_PROJECT, bucketName, IT_SERVICE_ACCOUNT_EMAIL);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
+      assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("was not found");
+    }
   }
 }
diff --git a/samples/snippets/src/test/java/com/example/storage/object/AddFileOwnerTest.java b/samples/snippets/src/test/java/com/example/storage/object/AddBlobOwnerTest.java
similarity index 54%
rename from samples/snippets/src/test/java/com/example/storage/object/AddFileOwnerTest.java
rename to samples/snippets/src/test/java/com/example/storage/object/AddBlobOwnerTest.java
index 7d56878a..09d3c76e 100644
--- a/samples/snippets/src/test/java/com/example/storage/object/AddFileOwnerTest.java
+++ b/samples/snippets/src/test/java/com/example/storage/object/AddBlobOwnerTest.java
@@ -16,26 +16,30 @@
 
 package com.example.storage.object;
 
+import static com.example.storage.Env.GOOGLE_CLOUD_PROJECT;
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_EMAIL;
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_USER;
 import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
+import static com.google.common.truth.Truth.assertWithMessage;
 
 import com.example.storage.TestBase;
-import com.google.cloud.storage.Acl.User;
+import com.google.cloud.storage.BlobId;
+import com.google.cloud.storage.BlobInfo;
 import org.junit.Test;
 
-public class AddFileOwnerTest extends TestBase {
-
-  public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL");
+public class AddBlobOwnerTest extends TestBase {
 
   @Test
-  public void testAddFileOwner() {
+  public void testAddBlobOwner() {
     // Check for user email before the actual test.
-    assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL);
+    assertWithMessage("Unable to determine user email").that(IT_SERVICE_ACCOUNT_EMAIL).isNotEmpty();
 
+    BlobInfo gen1 = createEmptyObject();
+    BlobId id = gen1.getBlobId();
     // Add Ownership to the file.
-    AddFileOwner.addFileOwner(
-        System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName, IT_SERVICE_ACCOUNT_EMAIL, blobName);
+    AddBlobOwner.addBlobOwner(
+        GOOGLE_CLOUD_PROJECT, id.getBucket(), IT_SERVICE_ACCOUNT_EMAIL, id.getName());
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
-    assertThat(blob.getAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNotNull();
+    assertThat(storage.getAcl(id, IT_SERVICE_ACCOUNT_USER)).isNotNull();
   }
 }
diff --git a/samples/snippets/src/test/java/com/example/storage/object/DownloadBytesRangeTest.java b/samples/snippets/src/test/java/com/example/storage/object/DownloadBytesRangeTest.java
index c20be679..21db918a 100644
--- a/samples/snippets/src/test/java/com/example/storage/object/DownloadBytesRangeTest.java
+++ b/samples/snippets/src/test/java/com/example/storage/object/DownloadBytesRangeTest.java
@@ -18,7 +18,11 @@ package com.example.storage.object;
 
 import static com.google.common.truth.Truth.assertThat;
 
+import com.example.storage.Env;
 import com.example.storage.TestBase;
+import com.google.cloud.storage.BlobId;
+import com.google.cloud.storage.BlobInfo;
+import com.google.cloud.storage.Storage.BlobTargetOption;
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
@@ -43,7 +47,11 @@ public class DownloadBytesRangeTest extends TestBase {
       's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
     };
 
-    blob = storage.create(blob, bytes);
+    BlobInfo gen1 = storage.create(
+        BlobInfo.newBuilder(bucket, generator.randomObjectName()).build(),
+        bytes,
+        BlobTargetOption.doesNotExist()
+    );
 
     File file = tmp.newFile();
 
@@ -53,10 +61,11 @@ public class DownloadBytesRangeTest extends TestBase {
 
     try {
       String destFileName = file.getAbsolutePath();
+      BlobId id = gen1.getBlobId();
       DownloadByteRange.downloadByteRange(
-          System.getenv("GOOGLE_CLOUD_PROJECT"),
-          bucketName,
-          blobName,
+          Env.GOOGLE_CLOUD_PROJECT,
+          id.getBucket(),
+          id.getName(),
           startByte,
           endBytes,
           destFileName);
diff --git a/samples/snippets/src/test/java/com/example/storage/object/PrintFileAclForUserTest.java b/samples/snippets/src/test/java/com/example/storage/object/PrintBlobAclForUserTest.java
similarity index 54%
rename from samples/snippets/src/test/java/com/example/storage/object/PrintFileAclForUserTest.java
rename to samples/snippets/src/test/java/com/example/storage/object/PrintBlobAclForUserTest.java
index 20c728ed..82939623 100644
--- a/samples/snippets/src/test/java/com/example/storage/object/PrintFileAclForUserTest.java
+++ b/samples/snippets/src/test/java/com/example/storage/object/PrintBlobAclForUserTest.java
@@ -16,40 +16,45 @@
 
 package com.example.storage.object;
 
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_USER;
 import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
+import static com.google.common.truth.Truth.assertWithMessage;
 
+import com.example.storage.Env;
 import com.example.storage.TestBase;
 import com.google.cloud.storage.Acl;
-import com.google.cloud.storage.Acl.Entity;
 import com.google.cloud.storage.Acl.Role;
-import com.google.cloud.storage.Acl.User;
+import com.google.cloud.storage.BlobId;
+import com.google.cloud.storage.BlobInfo;
 import org.junit.Test;
 
-public class PrintFileAclForUserTest extends TestBase {
+public class PrintBlobAclForUserTest extends TestBase {
 
-  public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL");
+  public static final String IT_SERVICE_ACCOUNT_EMAIL = Env.IT_SERVICE_ACCOUNT_EMAIL;
 
   @Test
-  public void testPrintBucketAclByUser() {
+  public void testPrintBucketAclByUser() throws Exception {
     // Check for user email before the actual test.
-    assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL);
+    assertWithMessage("Unable to determine user email").that(IT_SERVICE_ACCOUNT_EMAIL).isNotEmpty();
 
-    Entity testUser = new User(IT_SERVICE_ACCOUNT_EMAIL);
-    blob.createAcl(Acl.of(testUser, Role.READER));
-    PrintFileAclForUser.printFileAclForUser(bucketName, blobName, IT_SERVICE_ACCOUNT_EMAIL);
+    BlobInfo gen1 = createEmptyObject();
+    BlobId id = gen1.getBlobId();
+    storage.createAcl(id, Acl.of(IT_SERVICE_ACCOUNT_USER, Role.READER));
+    PrintBlobAclForUser.printBlobAclForUser(id.getBucket(), id.getName(), IT_SERVICE_ACCOUNT_EMAIL);
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(Role.READER.name());
   }
 
   @Test
-  public void testUserNotFound() {
+  public void testUserNotFound() throws Exception {
     // Check for user email before the actual test.
-    assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL);
+    assertWithMessage("Unable to determine user email").that(IT_SERVICE_ACCOUNT_EMAIL).isNotEmpty();
 
+    BlobInfo gen1 = createEmptyObject();
+    BlobId id = gen1.getBlobId();
     // Delete Acl just in case to make sure the User ACL is not present
-    blob.deleteAcl(new User(IT_SERVICE_ACCOUNT_EMAIL));
-    PrintFileAclForUser.printFileAclForUser(bucketName, blobName, IT_SERVICE_ACCOUNT_EMAIL);
+    storage.deleteAcl(id, IT_SERVICE_ACCOUNT_USER);
+    PrintBlobAclForUser.printBlobAclForUser(id.getBucket(), id.getName(), IT_SERVICE_ACCOUNT_EMAIL);
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("not found");
   }
diff --git a/samples/snippets/src/test/java/com/example/storage/object/PrintFileAclTest.java b/samples/snippets/src/test/java/com/example/storage/object/PrintBlobAclTest.java
similarity index 57%
rename from samples/snippets/src/test/java/com/example/storage/object/PrintFileAclTest.java
rename to samples/snippets/src/test/java/com/example/storage/object/PrintBlobAclTest.java
index 23bf7e7c..04eb9e65 100644
--- a/samples/snippets/src/test/java/com/example/storage/object/PrintFileAclTest.java
+++ b/samples/snippets/src/test/java/com/example/storage/object/PrintBlobAclTest.java
@@ -16,28 +16,31 @@
 
 package com.example.storage.object;
 
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_USER;
 import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
+import static com.google.common.truth.Truth.assertWithMessage;
 
+import com.example.storage.Env;
 import com.example.storage.TestBase;
 import com.google.cloud.storage.Acl;
-import com.google.cloud.storage.Acl.Entity;
 import com.google.cloud.storage.Acl.Role;
-import com.google.cloud.storage.Acl.User;
+import com.google.cloud.storage.BlobId;
+import com.google.cloud.storage.BlobInfo;
 import org.junit.Test;
 
-public class PrintFileAclTest extends TestBase {
+public class PrintBlobAclTest extends TestBase {
 
-  public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL");
+  public static final String IT_SERVICE_ACCOUNT_EMAIL = Env.IT_SERVICE_ACCOUNT_EMAIL;
 
   @Test
-  public void testPrintFileAcls() {
+  public void testPrintBlobAcls() {
     // Check for user email before the actual test.
-    assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL);
+    assertWithMessage("Unable to determine user email").that(IT_SERVICE_ACCOUNT_EMAIL).isNotEmpty();
 
-    Entity testUser = new User(IT_SERVICE_ACCOUNT_EMAIL);
-    blob.createAcl(Acl.of(testUser, Role.READER));
-    PrintFileAcl.printFileAcl(bucketName, blobName);
+    BlobInfo gen1 = createEmptyObject();
+    BlobId id = gen1.getBlobId();
+    storage.createAcl(id, Acl.of(IT_SERVICE_ACCOUNT_USER, Role.READER));
+    PrintBlobAcl.printBlobAcl(id.getBucket(), id.getName());
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("READER: USER");
   }
 }
diff --git a/samples/snippets/src/test/java/com/example/storage/object/RemoveFileOwnerTest.java b/samples/snippets/src/test/java/com/example/storage/object/RemoveBlobOwnerTest.java
similarity index 56%
rename from samples/snippets/src/test/java/com/example/storage/object/RemoveFileOwnerTest.java
rename to samples/snippets/src/test/java/com/example/storage/object/RemoveBlobOwnerTest.java
index 9d8936c7..32505404 100644
--- a/samples/snippets/src/test/java/com/example/storage/object/RemoveFileOwnerTest.java
+++ b/samples/snippets/src/test/java/com/example/storage/object/RemoveBlobOwnerTest.java
@@ -16,48 +16,49 @@
 
 package com.example.storage.object;
 
+import static com.example.storage.Env.GOOGLE_CLOUD_PROJECT;
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_EMAIL;
+import static com.example.storage.Env.IT_SERVICE_ACCOUNT_USER;
 import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertNotNull;
+import static com.google.common.truth.Truth.assertWithMessage;
 
 import com.example.storage.TestBase;
 import com.google.cloud.storage.Acl;
 import com.google.cloud.storage.Acl.Role;
-import com.google.cloud.storage.Acl.User;
-import com.google.cloud.testing.junit4.MultipleAttemptsRule;
-import org.junit.Rule;
+import com.google.cloud.storage.BlobId;
+import com.google.cloud.storage.BlobInfo;
 import org.junit.Test;
 
-public class RemoveFileOwnerTest extends TestBase {
-
-  @Rule public MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(5);
-
-  public static final String IT_SERVICE_ACCOUNT_EMAIL = System.getenv("IT_SERVICE_ACCOUNT_EMAIL");
+public class RemoveBlobOwnerTest extends TestBase {
 
   @Test
-  public void testRemoveFileOwner() {
+  public void testRemoveBlobOwner() {
     // Check for user email before the actual test.
-    assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL);
+    assertWithMessage("Unable to determine user email").that(IT_SERVICE_ACCOUNT_EMAIL).isNotEmpty();
 
+    BlobInfo gen1 = createEmptyObject();
+    BlobId id = gen1.getBlobId();
     // Add User as Owner
-    Acl newFileOwner = Acl.of(new User(IT_SERVICE_ACCOUNT_EMAIL), Role.OWNER);
-    blob.createAcl(newFileOwner);
+    Acl newFileOwner = Acl.of(IT_SERVICE_ACCOUNT_USER, Role.OWNER);
+    storage.createAcl(id, newFileOwner);
 
     // Remove User as owner
-    RemoveFileOwner.removeFileOwner(
-        System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName, IT_SERVICE_ACCOUNT_EMAIL, blobName);
+    RemoveBlobOwner.removeBlobOwner(
+        GOOGLE_CLOUD_PROJECT, id.getBucket(), IT_SERVICE_ACCOUNT_EMAIL, id.getName());
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("Removed user");
-    assertThat(blob.getAcl(new User(IT_SERVICE_ACCOUNT_EMAIL))).isNull();
   }
 
   @Test
   public void testUserNotFound() {
     // Check for user email before the actual test.
-    assertNotNull("Unable to determine user email", IT_SERVICE_ACCOUNT_EMAIL);
+    assertWithMessage("Unable to determine user email").that(IT_SERVICE_ACCOUNT_EMAIL).isNotEmpty();
 
+    BlobInfo gen1 = createEmptyObject();
+    BlobId id = gen1.getBlobId();
     // Remove User without Owner Permissions
-    RemoveFileOwner.removeFileOwner(
-        System.getenv("GOOGLE_CLOUD_PROJECT"), bucketName, IT_SERVICE_ACCOUNT_EMAIL, blobName);
+    RemoveBlobOwner.removeBlobOwner(
+        GOOGLE_CLOUD_PROJECT, id.getBucket(), IT_SERVICE_ACCOUNT_EMAIL, id.getName());
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains(IT_SERVICE_ACCOUNT_EMAIL);
     assertThat(stdOut.getCapturedOutputAsUtf8String()).contains("was not found");
   }
diff --git a/samples/snippets/src/test/java/com/example/storage/transfermanager/ITTransferManagerSamples.java b/samples/snippets/src/test/java/com/example/storage/transfermanager/ITTransferManagerSamples.java
index 89b52d52..232222c0 100644
--- a/samples/snippets/src/test/java/com/example/storage/transfermanager/ITTransferManagerSamples.java
+++ b/samples/snippets/src/test/java/com/example/storage/transfermanager/ITTransferManagerSamples.java
@@ -17,129 +17,141 @@
 
 package com.example.storage.transfermanager;
 
+import static com.example.storage.Env.GOOGLE_CLOUD_PROJECT;
+import static com.google.cloud.storage.TestUtils.assertAll;
 import static com.google.common.truth.Truth.assertThat;
 
+import com.example.storage.TestBase;
 import com.google.cloud.storage.BlobInfo;
 import com.google.cloud.storage.BucketInfo;
-import com.google.cloud.storage.Storage;
-import com.google.cloud.storage.it.BucketCleaner;
-import com.google.cloud.storage.testing.RemoteStorageHelper;
-import com.google.cloud.testing.junit4.StdOutCaptureRule;
+import com.google.cloud.storage.DataGenerator;
+import com.google.cloud.storage.Storage.BlobTargetOption;
+import com.google.cloud.storage.TmpFile;
+import com.google.cloud.storage.it.TemporaryBucket;
 import com.google.common.collect.ImmutableList;
-import java.io.File;
 import java.io.IOException;
 import java.nio.file.Path;
-import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import java.util.stream.Stream;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
-public class ITTransferManagerSamples {
-  private static final String BUCKET = RemoteStorageHelper.generateBucketName();
-  private static Storage storage;
-  private static List<BlobInfo> blobs;
-  private static List<BlobInfo> bigBlob;
-  private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
-  @Rule public final StdOutCaptureRule stdOutCaptureRule = new StdOutCaptureRule();
-  @Rule public final TemporaryFolder tmp = new TemporaryFolder();
-  @Rule public final TemporaryFolder tmpDirectory = new TemporaryFolder();
+public class ITTransferManagerSamples extends TestBase {
 
-  @BeforeClass
-  public static void beforeClass() {
-    RemoteStorageHelper helper = RemoteStorageHelper.create();
-    storage = helper.getOptions().getService();
-    storage.create(BucketInfo.of(BUCKET));
-    blobs =
-        Arrays.asList(
-            BlobInfo.newBuilder(BUCKET, "blob1").build(),
-            BlobInfo.newBuilder(BUCKET, "blob2").build(),
-            BlobInfo.newBuilder(BUCKET, "blob3").build());
-    for (BlobInfo blob : blobs) {
-      storage.create(blob);
-    }
-  }
-
-  @AfterClass
-  public static void afterClass() throws Exception {
-    try (Storage ignore = storage) {
-      BucketCleaner.doCleanup(BUCKET, storage);
-    }
-  }
+  @Rule public final TemporaryFolder downloadDirectory = new TemporaryFolder();
+  @Rule public final TemporaryFolder uploadDirectory = new TemporaryFolder();
 
   @Test
   public void uploadFiles() throws Exception {
-    File tmpFile = File.createTempFile("file", ".txt");
-    File tmpFile2 = File.createTempFile("file2", ".txt");
-    File tmpFile3 = File.createTempFile("file3", ".txt");
-    List<Path> files = ImmutableList.of(tmpFile.toPath(), tmpFile2.toPath(), tmpFile3.toPath());
-    UploadMany.uploadManyFiles(BUCKET, files);
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
-    assertThat(snippetOutput.contains("file")).isTrue();
-    assertThat(snippetOutput.contains("file2")).isTrue();
-    assertThat(snippetOutput.contains("file3")).isTrue();
+    Path baseDir = uploadDirectory.getRoot().toPath();
+    try (
+        TmpFile file1 = DataGenerator.base64Characters().tempFile(baseDir, 13);
+        TmpFile file2 = DataGenerator.base64Characters().tempFile(baseDir, 17);
+        TmpFile file3 = DataGenerator.base64Characters().tempFile(baseDir, 19)
+    ) {
+      List<Path> files = Stream.of(file1, file2, file3)
+          .map(TmpFile::getPath)
+          .collect(ImmutableList.toImmutableList());
+      UploadMany.uploadManyFiles(bucket.getName(), files);
+      String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
+      assertAll(
+          () -> assertThat(snippetOutput).contains(file1.getPath().getFileName().toString()),
+          () -> assertThat(snippetOutput).contains(file2.getPath().getFileName().toString()),
+          () -> assertThat(snippetOutput).contains(file3.getPath().getFileName().toString())
+      );
+    }
   }
 
   @Test
-  public void uploadDirectory() throws IOException {
-    File tmpFile = tmpDirectory.newFile("fileDirUpload.txt");
-    File tmpFile2 = tmpDirectory.newFile("fileDirUpload2.txt");
-    File tmpFile3 = tmpDirectory.newFile("fileDirUpload3.txt");
-    UploadDirectory.uploadDirectoryContents(BUCKET, tmpDirectory.getRoot().toPath());
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
-    assertThat(snippetOutput.contains("fileDirUpload.txt")).isTrue();
-    assertThat(snippetOutput.contains("fileDirUpload2.txt")).isTrue();
-    assertThat(snippetOutput.contains("fileDirUpload3.txt")).isTrue();
+  public void uploadDirectory() throws Exception {
+    Path baseDir = uploadDirectory.getRoot().toPath();
+    try (
+        TmpFile file1 = DataGenerator.base64Characters().tempFile(baseDir, 13);
+        TmpFile file2 = DataGenerator.base64Characters().tempFile(baseDir, 17);
+        TmpFile file3 = DataGenerator.base64Characters().tempFile(baseDir, 19)
+    ) {
+      UploadDirectory.uploadDirectoryContents(bucket.getName(), baseDir);
+      String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
+      assertAll(
+          () -> assertThat(snippetOutput).contains(file1.getPath().getFileName().toString()),
+          () -> assertThat(snippetOutput).contains(file2.getPath().getFileName().toString()),
+          () -> assertThat(snippetOutput).contains(file3.getPath().getFileName().toString())
+      );
+    }
   }
 
   @Test
-  public void downloadBucket() {
-    String downloadFullBucketName = RemoteStorageHelper.generateBucketName();
-    storage.create(BucketInfo.of(downloadFullBucketName));
-    List<BlobInfo> bucketBlobs =
-        Arrays.asList(
-            BlobInfo.newBuilder(downloadFullBucketName, "bucketb1").build(),
-            BlobInfo.newBuilder(downloadFullBucketName, "bucketb2").build(),
-            BlobInfo.newBuilder(downloadFullBucketName, "bucketb3").build());
-    for (BlobInfo blob : bucketBlobs) {
-      storage.create(blob);
+  public void downloadBucket() throws Exception {
+    try (TemporaryBucket tmpBucket = TemporaryBucket.newBuilder()
+        .setBucketInfo(BucketInfo.newBuilder(generator.randomBucketName()).build())
+        .setStorage(storage)
+        .build()) {
+      BucketInfo bucket = tmpBucket.getBucket();
+      String name1 = generator.randomObjectName();
+      String name2 = generator.randomObjectName();
+      String name3 = generator.randomObjectName();
+      Stream.of(name1, name2, name3)
+          .map(name -> BlobInfo.newBuilder(bucket, name).build())
+          .forEach(info -> storage.create(info, BlobTargetOption.doesNotExist()));
+      DownloadBucket.downloadBucketContents(
+          GOOGLE_CLOUD_PROJECT, bucket.getName(), downloadDirectory.getRoot().toPath());
+      String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
+      assertAll(
+          () -> assertThat(snippetOutput).contains(name1),
+          () -> assertThat(snippetOutput).contains(name2),
+          () -> assertThat(snippetOutput).contains(name3)
+      );
     }
-    DownloadBucket.downloadBucketContents(
-        PROJECT_ID, downloadFullBucketName, tmp.getRoot().toPath());
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
-    assertThat(snippetOutput.contains("bucketb1")).isTrue();
-    assertThat(snippetOutput.contains("bucketb2")).isTrue();
-    assertThat(snippetOutput.contains("bucketb3")).isTrue();
   }
 
   @Test
-  public void downloadFiles() {
-    DownloadMany.downloadManyBlobs(BUCKET, blobs, tmp.getRoot().toPath());
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
-    assertThat(snippetOutput.contains("blob1")).isTrue();
-    assertThat(snippetOutput.contains("blob2")).isTrue();
-    assertThat(snippetOutput.contains("blob3")).isTrue();
+  public void downloadBlobs() throws Exception {
+    String name1 = generator.randomObjectName();
+    String name2 = generator.randomObjectName();
+    String name3 = generator.randomObjectName();
+    List<BlobInfo> blobs = Stream.of(name1, name2, name3)
+        .map(this::info)
+        .map(info -> storage.create(info, BlobTargetOption.doesNotExist()))
+        .collect(ImmutableList.toImmutableList());
+    DownloadMany.downloadManyBlobs(bucket.getName(), blobs, downloadDirectory.getRoot().toPath());
+    String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
+    assertAll(
+        () -> assertThat(snippetOutput).contains(name1),
+        () -> assertThat(snippetOutput).contains(name2),
+        () -> assertThat(snippetOutput).contains(name3)
+    );
   }
 
   @Test
   public void uploadAllowPCU() throws IOException {
-    File tmpFile = tmpDirectory.newFile("fileDirUpload.txt");
-    AllowParallelCompositeUpload.parallelCompositeUploadAllowed(
-        BUCKET, Collections.singletonList(tmpFile.toPath()));
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
-    assertThat(snippetOutput.contains("fileDirUpload.txt")).isTrue();
+    Path baseDir = uploadDirectory.getRoot().toPath();
+    try (
+        TmpFile file1 = DataGenerator.base64Characters().tempFile(baseDir, 313 *  1024 * 1024)
+    ) {
+      AllowParallelCompositeUpload.parallelCompositeUploadAllowed(
+          bucket.getName(), ImmutableList.of(file1.getPath()));
+      String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
+      assertThat(snippetOutput).contains(file1.getPath().getFileName().toString());
+    }
   }
 
   @Test
-  public void downloadAllowDivideAndConquer() {
+  public void downloadAllowDivideAndConquer() throws Exception {
+    String name1 = generator.randomObjectName();
+    String name2 = generator.randomObjectName();
+    String name3 = generator.randomObjectName();
+    List<BlobInfo> blobs = Stream.of(name1, name2, name3)
+        .map(this::info)
+        .map(info -> storage.create(info, BlobTargetOption.doesNotExist()))
+        .collect(ImmutableList.toImmutableList());
     AllowDivideAndConquerDownload.divideAndConquerDownloadAllowed(
-        blobs, BUCKET, tmp.getRoot().toPath());
-    String snippetOutput = stdOutCaptureRule.getCapturedOutputAsUtf8String();
-    assertThat(snippetOutput.contains("blob1")).isTrue();
-    assertThat(snippetOutput.contains("blob2")).isTrue();
-    assertThat(snippetOutput.contains("blob3")).isTrue();
+        blobs, bucket.getName(), downloadDirectory.getRoot().toPath());
+    String snippetOutput = stdOut.getCapturedOutputAsUtf8String();
+    assertAll(
+        () -> assertThat(snippetOutput).contains(name1),
+        () -> assertThat(snippetOutput).contains(name2),
+        () -> assertThat(snippetOutput).contains(name3)
+    );
   }
 }