DefaultContentMetadata implements ContentMetadata { @Override public final boolean contains(String name) { return metadata.containsKey(name); } 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 testContainsReturnsFalseWhenEmpty() throws Exception { assertThat(contentMetadata.contains("test metadata")).isFalse(); }
@Test public void testContainsReturnsTrueForInitialValue() throws Exception { contentMetadata = createContentMetadata("metadata name", "value"); assertThat(contentMetadata.contains("metadata name")).isTrue(); }