### Question:
IntArrayPgWriter extends Writer { @Override public void write(char[] cbuf, int off, int len) throws IOException { CharBuffer buf = CharBuffer.wrap(cbuf, off, len); while (buf.hasRemaining()) { char c = buf.get(); if (c == '\n') { add(); } else { value.append(c); } } add(); }  @Override void close(); @Override void flush(); @Override void write(char[] cbuf, int off, int len); List<Integer> result();  }### Answer:
@Test public void testWrite() throws Exception { assertInput("12\n54321\n23456789\n345670981"); assertInput("12\n54321\n23456789\n345670981\n"); }