@Test
public void testWrite() throws IOException {

    initWriter();
    for( int i = 0; i < 5; i++ ) {
        writer.next();
        writer.write();
    }
    initWriter();
    for( int i = 1; i <= 5; i++ ) {
        assertTrue(writer.hasNext());
        assertEquals((long) i, writer.next());
    }
}