AmazonS3Object { @Override public String toString() { return MoreObjects.toStringHelper(this) .add("region", region) .add("bucketName", bucketName) .add("key", key) .add("size", size) .add("eTag", eTag) .add("versionId", versionId) .toString(); } AmazonS3Object(
      final String region,
      final String bucketName,
      final String key,
      final long size,
      @Nullable final String eTag,
      @Nullable final String versionId); String getRegion(); String getBucketName(); String getKey(); long getSize(); Optional<String> getETag(); Optional<String> getVersionId(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testToString() { final String expected = "AmazonS3Object{region=us-east-1, bucketName=bucket-name, key=object-key," + " size=100, eTag=Optional[object eTag], versionId=Optional[object version]}"; assertThat(object.toString()).isEqualTo(expected); }