@Test
public void testFormatSourceByClass() {

    CompactFormatter cf = new CompactFormatter();
    LogRecord record = new LogRecord(Level.SEVERE, "");
    record.setSourceMethodName(null);
    record.setSourceClassName(Object.class.getName());
    record.setLoggerName("");
    String result = cf.formatSource(record);
    assertEquals(Object.class.getSimpleName(), result);
}