DefaultContentMetadata implements ContentMetadata { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } return isMetadataEqual(metadata, ((DefaultContentMetadata) o).metadata); } DefaultContentMetadata();  DefaultContentMetadata(Map<String, byte[]> metadata); DefaultContentMetadata copyWithMutationsApplied(ContentMetadataMutations mutations); Set<Entry<String, byte[]>> entrySet(); @Override @Nullable final byte[] get(String name, @Nullable byte[] defaultValue); @Override @Nullable final String get(String name, @Nullable String defaultValue); @Override final long get(String name, long defaultValue); @Override final boolean contains(String name); @Override boolean equals(@Nullable Object o); @Override int hashCode(); static final DefaultContentMetadata EMPTY; }
@Test public void testEquals() throws Exception { DefaultContentMetadata metadata1 = createContentMetadata( "metadata1", "value", "metadata2", 12345, "metadata3", new byte[] {1, 2, 3}); DefaultContentMetadata metadata2 = createContentMetadata( "metadata2", 12345, "metadata3", new byte[] {1, 2, 3}, "metadata1", "value"); assertThat(metadata1).isEqualTo(metadata2); assertThat(metadata1.hashCode()).isEqualTo(metadata2.hashCode()); }