### Question:
ClassPathResource extends Resource { @Override public boolean exists() { InputStream is = getInputStream(); boolean result = is != null; try{ if (is != null) { is.close(); } } catch (Exception e) { } return result; } ClassPathResource(String path); @Override InputStream getInputStream(); @Override boolean exists();  }### Answer:
@Test public void testCreateClassPathResourceThatDoNotExist() throws Exception { final ClassPathResource classPathResource = new ClassPathResource(NON_EXISITING_CLASSPATH_RESOURCE); assertFalse(classPathResource.exists()); }