@Test
public void testFormatSourceByClassAndMethod() {

    CompactFormatter cf = new CompactFormatter();
    LogRecord record = new LogRecord(Level.SEVERE, "");
    record.setSourceMethodName("method");
    record.setSourceClassName(Object.class.getName());
    record.setLoggerName("");
    String result = cf.formatSource(record);
    assertFalse(result, record.getSourceClassName().equals(record.getSourceMethodName()));
    assertTrue(result, result.startsWith(Object.class.getSimpleName()));
    assertTrue(result, result.endsWith(record.getSourceMethodName()));
}