LogLevelMap { public static Builder builder() { return new Builder(); } private  LogLevelMap(Map<String, ? extends Level> map, Level defaultLevel); static Builder builder(); static LogLevelMap create(Level level); static LogLevelMap create(Map<String, ? extends Level> map); static LogLevelMap create(Map<String, ? extends Level> map, Level defaultLevel); Level getLevel(String loggerName); LogLevelMap merge(LogLevelMap other);  }
@Test public void testBuilder() { LogLevelMap levelMap = LogLevelMap.builder() .add(Level.FINE, String.class) .add(Level.WARNING, String.class.getPackage()) .setDefault(Level.INFO) .build(); assertThat(levelMap.getLevel("com.google")).isEqualTo(Level.INFO); assertThat(levelMap.getLevel("java.lang")).isEqualTo(Level.WARNING); assertThat(levelMap.getLevel("java.lang.String")).isEqualTo(Level.FINE); }