### Question:
ClassPathResource { public static InputStream asInputStream(String path) { return new ClassPathResource(path).asInputStream(); } private  ClassPathResource(String path); static String asString(String path); static InputStream asInputStream(String path);  }### Answer:
@Test(expected = RuntimeException.class) public void asInputStreamWithMissingResourceThrowsException() throws Exception { ClassPathResource.asInputStream(MISSING_RESOURCE); }
@Test public void asInputStreamWithExistingResourceReturnsInputStream() throws Exception { assertNotNull(ClassPathResource.asInputStream(EXISTING_RESOURCE)); }