public void addLine(String line) {
        try {
            writer.append(line);
        } catch (IOException ex) {
            // unexpected
            throw new RuntimeException(ex);
        }
        addNewLine();
    }
@Test
    public void testAddLine() throws Exception {
        try (MockFileOutput output = new MockFileOutput()) {
            LineEncoder encoder = newEncoder("utf-8", "LF", output);
            encoder.nextFile();
            for (String line : new String[] { "abc", "日本語(Japanese)" }) {
                encoder.addLine(line);
            }
            encoder.finish();
            // TODO
            //Iterator<Buffer> ite = output.getLastBuffers().iterator();
            //assertEquals("abc", bufferToString(ite.next(), "utf-8"));
            //assertEquals("\n", bufferToString(ite.next(), "utf-8"));
            //assertEquals("日本語(Japanese)", bufferToString(ite.next(), "utf-8"));
            //assertEquals("\n", bufferToString(ite.next(), "utf-8"));
            //assertFalse(ite.hasNext());
        }
    }