    @SuppressWarnings("ResultOfMethodCallIgnored")
    @Test
    public void testRotate() throws Exception {

        int lineSepLen = System.getProperty("line.separator").length();
        File f = File.createTempFile("log", null);
        RotatingFileWriter w = new RotatingFileWriter(f, 3000, 2);
        w.println(StringUtils.randomString(512));
        w.println(StringUtils.randomString(512));
        w.println(StringUtils.randomString(512));
        w.println(StringUtils.randomString(512));
        w.flush();
        assertEquals((512*4)+(lineSepLen*4), f.length());
        w.println(StringUtils.randomString(512));
        w.flush();
        assertEquals((512*5)+(lineSepLen*5), f.length());
        w.println(StringUtils.randomString(512));
        // rotation threshold
        w.flush();
        assertEquals((512*4)+(lineSepLen*4), f.length());
        w.println(StringUtils.randomString(512));
        w.flush();
        assertEquals((512*5)+(lineSepLen*5), f.length());
        w.println(StringUtils.randomString(512));
        // rotation threshold
        w.flush();
        assertEquals((512*4)+(lineSepLen*4), f.length());
        w.close();
        f.delete();
    }