@Test
public void getMetadataHeadersToPutReturnsExpected() {

    final MetadataHeaderKey specificMetadataKey = MetadataHeaderKey.parse("/foo/bar/baz");
    final JsonValue metadataValue1 = JsonValue.of(1);
    final MetadataHeaderKey wildcardMetadataKey = MetadataHeaderKey.parse("/*/aValue");
    final JsonValue metadataValue2 = JsonValue.of(2);
    final MetadataHeaders expected = MetadataHeaders.newInstance();
    expected.add(MetadataHeader.of(wildcardMetadataKey, metadataValue2));
    expected.add(MetadataHeader.of(specificMetadataKey, metadataValue1));
    final Map<String, String> headerMap = new HashMap<>();
    headerMap.put(DittoHeaderDefinition.PUT_METADATA.getKey(), expected.toJsonString());
    final ImmutableDittoHeaders underTest = ImmutableDittoHeaders.of(headerMap);
    assertThat(underTest.getMetadataHeadersToPut()).isEqualTo(expected);
}