### Question:
SessionIDCorrector { public String translateSiteID(String primaryID, String siteID) { return update(new ResolvedServer(primaryID, siteID)).getSiteID(); } SessionIDCorrector(Map<String, String> serverToSite); static SessionIDCorrector create(); String translatePrimaryID(String primaryID, String siteID); String translateSiteID(String primaryID, String siteID); @Override String toString(); static final String HEADER; }### Answer:
@Test public void shouldLeaveServerIDInSiteIDFieldWhenNoMappingsPresent() { SessionIDCorrector corrector = generateAutocorrect(""); String result = corrector.translateSiteID("", "01"); assertThat(result).isEqualTo("01"); }
@Test public void shouldMapUpdateSiteIDWhenMappingServerToSite() { SessionIDCorrector corrector = generateAutocorrect("01,02"); String result = corrector.translateSiteID("", "01"); assertThat(result).isEqualTo("02"); }
@Test public void shouldStripSiteFromServer() { SessionIDCorrector corrector = generateAutocorrect("01,--"); String result = corrector.translateSiteID("01", "02"); assertThat(result).isEqualTo("01"); }