CollectorFormatter extends Formatter { protected String finish(String s) { return s.trim(); } CollectorFormatter();  CollectorFormatter(String format);  CollectorFormatter(String format, Formatter f,
            Comparator<? super LogRecord> c); @Override String format(final LogRecord record); @Override String getTail(final Handler h); @Override String toString();  }
@Test(expected = NullPointerException.class) public void testFinishNull() { CollectorFormatter f = new CollectorFormatter(); String result = f.finish((String) null); fail(result); }
@Test public void testFinish() { CollectorFormatter f = new CollectorFormatter(); String format = LINE_SEP + f.getClass().getName() + LINE_SEP; assertFalse(f.getClass().getName().equals(format)); assertEquals(f.getClass().getName(), f.finish(format)); }