public static Profiler createIfDebug(Logger logger) {
    if (logger.isDebugEnabled()) {
      return create(logger);
    }
    return NullProfiler.NULL_INSTANCE;
  }
@Test
  public void create_null_profiler_if_debug_level_is_disabled() {
    tester.setLevel(LoggerLevel.TRACE);
    Profiler profiler = Profiler.createIfDebug(LoggerFactory.getLogger("foo"));
    assertThat(profiler).isInstanceOf(DefaultProfiler.class);

    tester.setLevel(LoggerLevel.INFO);
    profiler = Profiler.createIfDebug(LoggerFactory.getLogger("foo"));
    assertThat(profiler).isInstanceOf(NullProfiler.class);
  }