### Question:
ClasspathHelper { public static String loadFileFromClasspath(String location) { InputStream inputStream = ClasspathHelper.class.getResourceAsStream(location); if(inputStream == null) { inputStream = ClasspathHelper.class.getClassLoader().getResourceAsStream(location); } if(inputStream == null) { inputStream = ClassLoader.getSystemResourceAsStream(location); } if(inputStream != null) { try { return IOUtils.toString(inputStream); } catch (IOException e) { throw new RuntimeException("Could not read " + location + " from the classpath", e); } } throw new RuntimeException("Could not find " + location + " on the classpath"); }  static String loadFileFromClasspath(String location);  }### Answer:
@Test public void testLoadFileFromClasspath() throws Exception { final String contents = ClasspathHelper.loadFileFromClasspath("classpathTest.txt"); assertEquals(contents, "How now brown cow?"); }
@Test(expectedExceptions = {RuntimeException.class}) public void testLoadFileFromClasspath_DoesntExist() throws Exception { ClasspathHelper.loadFileFromClasspath("nothing.txt"); }