rfa.setFormatter(layout);
rfa.setFormatter((ExtendedFormatter)layout);
    public void test5() throws Exception {        PatternFormatter layout = new PatternFormatter("%c{1} - %m%n");        RollingFileHandler rfa = new RollingFileHandler("TimeBasedRollingTest.test5");        rfa.setFormatter(layout);        String datePattern = "yyyy-MM-dd_HH_mm_ss";        TimeBasedRollingPolicy tbrp = new TimeBasedRollingPolicy("output/test5-%d{" + datePattern + "}");        rfa.setFile("output/test5.log");        tbrp.activateOptions();        rfa.setRollingPolicy(tbrp);        rfa.activateOptions();        this.logger.addHandler(rfa);        SimpleDateFormat sdf = new SimpleDateFormat(datePattern);        String[] filenames = new String[4];        Calendar cal = Calendar.getInstance();        for (int i = 0; i < 3; i++) {            filenames[i] = "output/test5-" + sdf.format(cal.getTime());            cal.add(Calendar.SECOND, 1);        }        filenames[3] = "output/test5.log";        System.out.println("Waiting until next second and 100 millis.");        delayUntilNextSecond(100);        System.out.println("Done waiting.");        for (int i = 0; i < 5; i++) {            this.logger.finer("Hello---" + i);            Thread.sleep(500);        }        for (int i = 0; i < 4; i++) {            assertTrue(Compare.compare(filenames[i], "witness/rolling/tbr-test5." + i));        }    }