IfNoneMatchPreconditionHeader implements PreconditionHeader<EntityTag> { public static Optional<IfNoneMatchPreconditionHeader> fromDittoHeaders(final DittoHeaders dittoHeaders) { return dittoHeaders.getIfNoneMatch().map(IfNoneMatchPreconditionHeader::new); } private  IfNoneMatchPreconditionHeader(final EntityTagMatchers entityTagsToMatch); @Override String getKey(); @Override String getValue(); @Override boolean meetsConditionFor(@Nullable final EntityTag entityTag); static Optional<IfNoneMatchPreconditionHeader> fromDittoHeaders(final DittoHeaders dittoHeaders);  }
@Test public void fromDittoHeaders() { final DittoHeaders dittoHeaders = DittoHeaders.newBuilder().ifNoneMatch(EntityTagMatchers.fromCommaSeparatedString("*")).build(); final Optional<IfNoneMatchPreconditionHeader> ifNoneMatchPreconditionHeader = IfNoneMatchPreconditionHeader.fromDittoHeaders(dittoHeaders); Assertions.assertThat(ifNoneMatchPreconditionHeader).isPresent(); assertThat(ifNoneMatchPreconditionHeader.get().getKey()).isEqualTo("if-none-match"); assertThat(ifNoneMatchPreconditionHeader.get().getValue()).isEqualTo("*"); }