InputStreamInput implements Input { @Override public int read() { try { return reader.read(); } 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 testRead() throws Exception { ByteArrayInputStream inputStream = new ByteArrayInputStream("foo".getBytes()); InputStreamInput input = new InputStreamInput(inputStream); Assert.assertEquals(input.read(), 'f'); Assert.assertEquals(input.read(), 'o'); Assert.assertEquals(input.read(), 'o'); Assert.assertEquals(input.read(), -1); }