### Question:
ResourceUtil { public static InputStream getResourceAsStream(String path) { assertNotNull(path); URL url = getResource(path); try { return url != null ? url.openStream() : null; } catch (IOException e) { return null; } }  static URL getResource(String path); static InputStream getResourceAsStream(String path); static String getResourceAsString(String path);  }### Answer:
@Test public void testGetResourceAsStream() { String path = getClass().getName().replace(".", "/") + ".txt"; InputStream inputStream = ResourceUtil.getResourceAsStream(path); assertNotNull(inputStream); }
@Test public void testGetResourceAsStream_nonexistentPath() { InputStream inputStream = ResourceUtil.getResourceAsStream("nonexistentPath"); assertNull(inputStream); }