InputStreamInput implements Input { @Override public String readLine() { try { return reader.readLine(); } catch (IOException e) { throw new ErrorMessage(e, "Error reading input"); } } InputStreamInput(InputStream inputStream);  InputStreamInput(BufferedReader reader); @Override int read(); @Override String readLine(); @Override Iterator<String> iterator();  }
@Test(groups = "fast") public void testReadLine() throws Exception { ByteArrayInputStream inputStream = new ByteArrayInputStream("Foo bar\nHello".getBytes()); InputStreamInput input = new InputStreamInput(inputStream); Assert.assertEquals(input.readLine(), "Foo bar"); Assert.assertEquals(input.readLine(), "Hello"); Assert.assertNull(input.readLine()); }