EntityTagMatcher { @SuppressWarnings("ConstantConditions") public boolean weakMatch(final EntityTag entityTagToMatch) { if (isAsterisk) { return true; } return entityTag.weakCompareTo(entityTagToMatch); } private  EntityTagMatcher(@Nullable final EntityTag entityTag, final boolean isAsterisk); static EntityTagMatcher fromString(final String entityTagMatcher); static EntityTagMatcher asterisk(); static boolean isValid(@Nullable final CharSequence entityTagMatcher); @SuppressWarnings("ConstantConditions") boolean strongMatch(final EntityTag entityTagToMatch); @SuppressWarnings("ConstantConditions") boolean weakMatch(final EntityTag entityTagToMatch); boolean isAsterisk(); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override @SuppressWarnings("ConstantConditions") String toString();  }
@Test public void weakMatchEvaluatesAlwaysToTrueIfMatcherIsAsterisk() { softly.assertThat(ASTERISK.weakMatch(STRONG_1)).isTrue(); softly.assertThat(ASTERISK.weakMatch(WEAK_1)).isTrue(); softly.assertThat(ASTERISK.weakMatch(WEAK_2)).isTrue(); softly.assertThat(ASTERISK.weakMatch(STRONG_2)).isTrue(); }