@Test
public void testForcedLoggingBypassesLoggerIfNeeded() {

  TestLogger logger = new TestLogger("loggy.mclogface", Level.INFO);
  TestBackend backend = new TestBackend(logger);
  // Forced and unforced logging is treated the same if it's enabled.
  backend.log(new LogRecord(Level.INFO, "Enabled and Forced"), true /* forced */);
  logger.assertLogged("Enabled and Forced");
  logger.assertPublished("Enabled and Forced");
  backend.assertUsedForcingLogger(false);
  // Forced logging at a level that's disabled must call the forcing logger instead.
  backend.log(new LogRecord(Level.FINE, "Disabled and Forced"), true /* forced */);
  logger.assertLogged(null);
  logger.assertPublished("Disabled and Forced");
  backend.assertUsedForcingLogger(true);
}