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