TinylogLogFactory extends LogFactory { @SuppressWarnings("rawtypes") @Override public Log getInstance(final Class clazz) { return log; } TinylogLogFactory(); @SuppressWarnings("rawtypes") @Override Log getInstance(final Class clazz); @Override Log getInstance(final String name); @Override String[] getAttributeNames(); @Override Object getAttribute(final String name); @Override void setAttribute(final String name, final Object value); @Override void removeAttribute(final String name); @Override void release();  }
@Test public void cachedLogInstance() { Log log = factory.getInstance("com.example.MyClass"); assertThat(log).isInstanceOf(TinylogLog.class); assertThat(factory.getInstance("com.example.OtherClass")).isSameAs(log); assertThat(factory.getInstance(TinylogLogFactoryTest.class)).isSameAs(log); }