### Question:
ClassPathResource { public static String asString(String path) { return new ClassPathResource(path).asString(); } private  ClassPathResource(String path); static String asString(String path); static InputStream asInputStream(String path);  }### Answer:
@Test(expected = RuntimeException.class) public void asStringWithMissingResourceThrowsException() throws Exception { ClassPathResource.asString(MISSING_RESOURCE); }
@Test public void asStringWithExistingResourceReturnsString() throws Exception { assertNotNull(ClassPathResource.asString(EXISTING_RESOURCE)); }
@Test(expected = IllegalArgumentException.class) public void throwsExceptionForMissingPath() throws Exception { ClassPathResource.asString(null); }
@Test(expected = IllegalArgumentException.class) public void throwsExceptionForEmptyPath() throws Exception { ClassPathResource.asString(""); }