### Question:
PipeResourceLocator { public URL getExample(String example) { return getResource(EXAMPLE_PATH,example,".xml"); }  URL getImage(String image); URL getExample(String example); URL getExamplePath(); URL getImagePath();  }### Answer:
@Test public void verifyGetsExample() { PipeResourceLocator locator = new PipeResourceLocator(); URL url = locator.getExample("ClassicGSPN"); assertTrue(url.getPath().endsWith("/extras/examples/ClassicGSPN.xml")); url = locator.getExample("Courier Protocol"); assertTrue(url.getPath().endsWith("/extras/examples/Courier%20Protocol.xml")); }
@Test public void verifyExampleNotFoundTellsWhereWeLooked() { expectedException.expect(RuntimeException.class); expectedException.expectMessage("Could not find nonexistent example.xml in "); PipeResourceLocator locator = new PipeResourceLocator(); locator.getExample("nonexistent example"); }