### Question:
MarkdownReplayer implements InteractionMonitor { public void setPlaybackConversation(String conversation) { this.filename = "no filename set"; int charPosn = -1; int ctr = 0; boolean again = true; while (again) { charPosn = conversation.indexOf(SERVIRTIUM_INTERACTION + ctr + ":", charPosn+1); int charEndPosn; if (charPosn > -1) { charEndPosn = conversation.indexOf(SERVIRTIUM_INTERACTION + (ctr+1) + ":", charPosn); if (charEndPosn == -1) { charEndPosn = conversation.length(); again = false; } String interactionText = conversation.substring(charPosn, charEndPosn); allMarkdownInteractions.add(interactionText); ctr++; } if (ctr == 0 && charPosn == -1) { again = false; } } if (ctr == 0) { throw new UnsupportedOperationException("No '" + SERVIRTIUM_INTERACTION.trim() + "' found in conversation '" + conversation + "'. Wrong/empty script file?"); } } MarkdownReplayer();  MarkdownReplayer(ReplayMonitor monitor); MarkdownReplayer withAlphaSortingOfHeaders(); void setScriptFilename(String filename); void setPlaybackConversation(String conversation); MarkdownReplayer withReplacementInPlayback(String regex, String replacement); MarkdownReplayer withReplacementsInPlayback(String... terms); @Override void finishedScript(int interactionNum, boolean failed); @Override ServiceResponse getServiceResponseForRequest(String method, String url,
                                                        Interaction interaction, boolean lowerCaseHeaders); @Override ReplayingInteraction newInteraction(int interactionNum, String context, String method, String path, String url); static final String SERVIRTIUM_INTERACTION; }### Answer:
@Test public void replayerShouldNotWorkWithoutAPreviouslyRecordedScript() { MarkdownReplayer m = new MarkdownReplayer(); try { m.setPlaybackConversation("oh noes"); fail("should have barfed"); } catch (UnsupportedOperationException e) { assertEquals("No '## Interaction' found in conversation 'oh noes'. Wrong/empty script file?", e.getMessage()); } }