IOUtil { public static InputStream getResourceAsStream(String name) { Assertion.on("name").mustNotBeNull(name); return IOUtil.class.getClassLoader().getResourceAsStream(name); } private  IOUtil(); static InputStream getResourceAsStream(String name); static final String readAsString(InputStream is, String encoding); static final List<String> readAsLineList(InputStream is);  }
@Test public void getResourceAsStream_A$String() throws Exception { String name = "inputs/Sample.txt"; InputStream actual = IOUtil.getResourceAsStream(name); assertNotNull(actual); IOUtils.closeQuietly(actual); }
@Test public void getResourceAsStream_A$String_StringIsNull() throws Exception { String name = null; try { IOUtil.getResourceAsStream(name); fail(); } catch (JUnitHelperCoreException e) { } }
@Test public void getResourceAsStream_A$String_StringIsEmpty() throws Exception { String name = ""; InputStream actual = IOUtil.getResourceAsStream(name); assertThat(actual, notNullValue()); }