RelocationIsPermanentRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return PERMANENT_RELOCATION_VALUE.equalsIgnoreCase(reportFields.get(CLOSE_REASON_FIELD_NAME)); }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnTrueIfRelocationIsPermanent() throws Exception { boolean didRuleApply = relocationIsPermanentRule.apply(new SafeMap().put("closeReason", "permanent_relocation")); assertTrue(didRuleApply); }
@Test public void shouldReturnFalseForAnyOtherCloseReason() throws Exception { boolean didRuleApply = relocationIsPermanentRule.apply(new SafeMap().put("closeReason", "child_death")); assertFalse(didRuleApply); }