IOUtil { public static final List<String> readAsLineList(InputStream is) throws IOException { List<String> dest = new ArrayList<String>(); BufferedReader br = null; try { br = new BufferedReader(new InputStreamReader(is)); String line = null; while ((line = br.readLine()) != null) { dest.add(line); } return dest; } finally { IOUtils.closeQuietly(br); } } 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 readAsLineList_A$InputStream() throws Exception { InputStream is = new ByteArrayInputStream(new byte[] {}); List<String> actual = IOUtil.readAsLineList(is); List<String> expected = Arrays.asList(new String[] {}); assertThat(actual, is(equalTo(expected))); }