### Question:
ClassResourceLoader extends ResourceLoader { @Override public InputStream getResourceStream(final String source) throws ResourceNotFoundException { final InputStream stream = ClassResourceLoader.class.getResourceAsStream(source); if (stream == null) { throw new ResourceNotFoundException("Resource not found: " + source); } return stream; }  @Override void init(final ExtendedProperties configuration); @Override InputStream getResourceStream(final String source); @Override boolean isSourceModified(final Resource resource); @Override long getLastModified(final Resource resource);  }### Answer:
@Test public void testGetResourceStream() throws Exception { try (final InputStream stream = loader.getResourceStream("ClassResourceLoader-testGetResourceStream.txt")) { assertThat(IOUtils.toString(stream, "utf-8")).isEqualTo("test"); } }
@Test public void testGetResourceStreamNotFound() throws Exception { final String source = "i will never ever exist!"; ResourceNotFoundException e = assertThrows(ResourceNotFoundException.class, () -> { loader.getResourceStream(source); }); assertThat(e.getMessage()).isEqualTo("Resource not found: " + source); }