### Question:
OffendingRule { public boolean matches(final Rule rule) { return rule != null && ((offendingRule.getValue() == null && rule.getValue() == null) || (offendingRule.getValue() .equals(rule.getValue()))); } OffendingRule(@JsonProperty("rule") final Rule offendingRule,
            @JsonProperty("message") final String errorMessage); Rule getOffendingRule(); String getErrorMessage(); boolean matches(final Rule rule); @Override final int hashCode(); @Override final boolean equals(final Object obj); @Override final String toString();  }### Answer:
@Test public final void should_match_with_rule_with_differentTag() { assertTrue(offending.matches(createTestRule(value, "another test"))); }
@Test public final void should_not_match_with_null_rule() { assertFalse(offending.matches(null)); }