IsSideEffectDueToSterilizationRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return !StringUtils.isBlank(reportFields.get(STERILIZATION_SIDE_EFFECT_FIELD_NAME)); }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnFalseWhenThereIsNoSideEffectDueToSterilization() { boolean didRuleSucceed = rule.apply(new SafeMap().put("sterilizationSideEffect", null)); assertFalse(didRuleSucceed); didRuleSucceed = rule.apply(new SafeMap().put("sterilizationSideEffect", "")); assertFalse(didRuleSucceed); }
@Test public void shouldReturnTrueWhenThereIsSideEffectDueToSterilization() { boolean didRuleSucceed = rule.apply(new SafeMap().put("sterilizationSideEffect", "headache")); assertTrue(didRuleSucceed); }