S3ResourceId implements ResourceId { @Override public boolean equals(@Nullable Object obj) { if (!(obj instanceof S3ResourceId)) { return false; } return bucket.equals(((S3ResourceId) obj).bucket) && key.equals(((S3ResourceId) obj).key); } private  S3ResourceId(
      String bucket, String key, @Nullable Long size, @Nullable Date lastModified); @Override ResourceId resolve(String other, ResolveOptions resolveOptions); @Override ResourceId getCurrentDirectory(); @Override String getScheme(); @Nullable @Override String getFilename(); @Override boolean isDirectory(); @Override String toString(); @Override boolean equals(@Nullable Object obj); @Override int hashCode();  }
@Test public void testEquals() { S3ResourceId a = S3ResourceId.fromComponents("bucket", "a/b/c"); S3ResourceId b = S3ResourceId.fromComponents("bucket", "a/b/c"); assertEquals(a, b); b = S3ResourceId.fromComponents(a.getBucket(), "a/b/c/"); assertNotEquals(a, b); b = S3ResourceId.fromComponents(a.getBucket(), "x/y/z"); assertNotEquals(a, b); b = S3ResourceId.fromComponents("other-bucket", a.getKey()); assertNotEquals(a, b); }