### Question:
RangerValidator { boolean getIsAuditEnabled(RangerPolicy policy) { if(LOG.isDebugEnabled()) { LOG.debug("<== RangerValidator.getIsAuditEnabled(" + policy + ")"); } boolean isEnabled = false; if (policy == null) { LOG.warn("policy was null!"); } else if (policy.getIsAuditEnabled() == null) { isEnabled = true; } else { isEnabled = policy.getIsAuditEnabled(); } if(LOG.isDebugEnabled()) { LOG.debug("<== RangerValidator.getIsAuditEnabled(" + policy + "): " + isEnabled); } return isEnabled; } protected  RangerValidator(ServiceStore store); void validate(Long id, Action action);  }### Answer:
@Test public void test_getIsAuditEnabled() { RangerPolicy policy = null; boolean result = _validator.getIsAuditEnabled(policy); assertFalse(result); policy = mock(RangerPolicy.class); when(policy.getIsAuditEnabled()).thenReturn(null); result = _validator.getIsAuditEnabled(policy); assertTrue(result); when(policy.getIsAuditEnabled()).thenReturn(Boolean.FALSE); result = _validator.getIsAuditEnabled(policy); assertFalse(result); when(policy.getIsAuditEnabled()).thenReturn(Boolean.TRUE); result = _validator.getIsAuditEnabled(policy); assertTrue(result); }