### Question:
ResourceReader { public final String readFile(String filename) { try (BufferedReader queryBuffer = new BufferedReader(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(filename)));) { return queryBuffer.lines().collect(Collectors.joining("\n")); } catch (IOException | NullPointerException e) { throw new RuntimeException("Could not load file: " + filename, e); } }  final String readFile(String filename);  }### Answer:
@Test public void should_read_resource_file_as_string() { String fileContents = new ResourceReader().readFile("ontology.ttl"); assertNotNull(fileContents); assertTrue(fileContents.length() > 0); }
@Test public void should_throw_runtime_exception_on_non_existant_file() { expectedEx.expect(RuntimeException.class); expectedEx.expectMessage("Could not load file: NONEXISTANT.TEST"); new ResourceReader().readFile("NONEXISTANT.TEST"); }