### Question:
AssuranceLevelUtil { public static CanonicalIdentityAssuranceLevel getAssuranceLevel(EmpiMatchResultEnum theMatchResult, EmpiLinkSourceEnum theSource) { switch (theSource) { case MANUAL: return getAssuranceFromManualResult(theMatchResult); case AUTO: return getAssuranceFromAutoResult(theMatchResult); } throw new InvalidRequestException("Couldn't figure out an assurance level for result: " + theMatchResult + " and source " + theSource); } private  AssuranceLevelUtil(); static CanonicalIdentityAssuranceLevel getAssuranceLevel(EmpiMatchResultEnum theMatchResult, EmpiLinkSourceEnum theSource);  }### Answer:
@Test public void testValidPersonLinkLevels() { assertThat(AssuranceLevelUtil.getAssuranceLevel(POSSIBLE_MATCH, AUTO), is(equalTo(LEVEL1))); assertThat(AssuranceLevelUtil.getAssuranceLevel(MATCH, AUTO), is(equalTo(LEVEL2))); assertThat(AssuranceLevelUtil.getAssuranceLevel(MATCH, MANUAL), is(equalTo(LEVEL3))); }
@Test public void testInvalidPersonLinkLevels() { try { AssuranceLevelUtil.getAssuranceLevel(NO_MATCH, AUTO); fail(); } catch (InvalidRequestException e) { assertEquals("An AUTO EMPI Link may not have a match result of NO_MATCH", e.getMessage()); } try { AssuranceLevelUtil.getAssuranceLevel(POSSIBLE_DUPLICATE, AUTO); fail(); } catch (InvalidRequestException e) { assertEquals("An AUTO EMPI Link may not have a match result of POSSIBLE_DUPLICATE", e.getMessage()); } try { AssuranceLevelUtil.getAssuranceLevel(NO_MATCH, MANUAL); fail(); } catch (InvalidRequestException e) { assertEquals("A MANUAL EMPI Link may not have a match result of NO_MATCH", e.getMessage()); } try { AssuranceLevelUtil.getAssuranceLevel(POSSIBLE_MATCH, MANUAL); fail(); } catch (InvalidRequestException e) { assertEquals("A MANUAL EMPI Link may not have a match result of POSSIBLE_MATCH", e.getMessage()); } try { AssuranceLevelUtil.getAssuranceLevel(POSSIBLE_DUPLICATE, MANUAL); fail(); } catch (InvalidRequestException e) { assertEquals("A MANUAL EMPI Link may not have a match result of POSSIBLE_DUPLICATE", e.getMessage()); } }