### Question:
ReferenceTokenReplacer { public String replaceReferenceTokens(String tokens, LaunchDataWrapper launchDataWrapper) { String agendaReferenceString = jsonReferenceReplacer.generateReference(AgendaToken.AGENDA_ID.getToken(), null); String agendaId = launchDataWrapper.getEnvironmentRetriever().getField(HandlerField.AGENDA_ID.name(), agendaReferenceString); return StringUtils.replace(tokens, agendaReferenceString, agendaId); } ReferenceTokenReplacer(); ReferenceTokenReplacer setJsonReferenceReplacer(JsonReferenceReplacer jsonReferenceReplacer); String replaceReferenceTokens(String tokens, LaunchDataWrapper launchDataWrapper);  }### Answer:
@Test public void testReplaceReferenceTokens() { final String AGENDA_ID = UUID.randomUUID().toString(); String tokens = jsonReferenceReplacer.generateReference(AgendaToken.AGENDA_ID.getToken(), null); doReturn(AGENDA_ID).when(mockEnvironmentFieldRetriever).getField(anyString(), anyString()); Assert.assertEquals(replacer.replaceReferenceTokens(tokens, mockLaunchDataWrapper), AGENDA_ID); }
@Test public void testReplaceReferenceTokensNoAgendaId() { String tokens = jsonReferenceReplacer.getReferenceName(AgendaToken.AGENDA_ID.getToken()); Assert.assertEquals(replacer.replaceReferenceTokens(tokens, mockLaunchDataWrapper), tokens); }