BundleLoggingProvider implements LoggingProvider { @Override public boolean isEnabled(final int depth, final String tag, final Level level) { for (int i = 0; i < loggingProviders.length; ++i) { if (loggingProviders[i].isEnabled(depth + 1, tag, level)) { return true; } } return false; } BundleLoggingProvider(final Collection<LoggingProvider> providers); @Override ContextProvider getContextProvider(); @Override Level getMinimumLevel(); @Override Level getMinimumLevel(final String tag); @Override boolean isEnabled(final int depth, final String tag, final Level level); @Override void log(final int depth, final String tag, final Level level, final Throwable exception, final MessageFormatter formatter,
		final Object obj, final Object... arguments); @Override void log(final String loggerClassName, final String tag, final Level level, final Throwable exception,
		final MessageFormatter formatter, final Object obj, final Object... arguments); @Override void shutdown();  }
@Test public void isEnabled() { init(Level.TRACE, Level.TRACE); when(first.isEnabled(anyInt(), isNull(), eq(Level.TRACE))).thenReturn(false); when(first.isEnabled(anyInt(), isNull(), eq(Level.DEBUG))).thenReturn(false); when(first.isEnabled(anyInt(), isNull(), eq(Level.INFO))).thenReturn(false); when(first.isEnabled(anyInt(), isNull(), eq(Level.WARN))).thenReturn(true); when(first.isEnabled(anyInt(), isNull(), eq(Level.ERROR))).thenReturn(true); when(second.isEnabled(anyInt(), isNull(), eq(Level.TRACE))).thenReturn(false); when(second.isEnabled(anyInt(), isNull(), eq(Level.DEBUG))).thenReturn(true); when(second.isEnabled(anyInt(), isNull(), eq(Level.INFO))).thenReturn(true); when(second.isEnabled(anyInt(), isNull(), eq(Level.WARN))).thenReturn(true); when(second.isEnabled(anyInt(), isNull(), eq(Level.ERROR))).thenReturn(true); assertThat(bundle.isEnabled(1, null, Level.TRACE)).isEqualTo(false); assertThat(bundle.isEnabled(1, null, Level.DEBUG)).isEqualTo(true); assertThat(bundle.isEnabled(1, null, Level.INFO)).isEqualTo(true); assertThat(bundle.isEnabled(1, null, Level.WARN)).isEqualTo(true); assertThat(bundle.isEnabled(1, null, Level.ERROR)).isEqualTo(true); verify(first, atLeastOnce()).isEnabled(eq(2), isNull(), any()); verify(second, atLeastOnce()).isEnabled(eq(2), isNull(), any()); }