@Test
public void testGetPatternLevels()
{

  Map<String, String> changes = Maps.newHashMap();
  changes.put("_.org.apache.*", "WARN");
  changes.put("_.com.datatorrent.io.fs.*", "DEBUG");
  changes.put("_.com.datatorrent.io.*", "ERROR");
  LoggerUtil.changeLoggersLevel(changes);
  Map<String, String> levels = LoggerUtil.getPatternLevels();
  assertEquals(3, levels.size());
  assertEquals(levels.get("_.org.apache.*"), "WARN");
  assertEquals(levels.get("_.com.datatorrent.io.fs.*"), "DEBUG");
  assertEquals(levels.get("_.com.datatorrent.io.*"), "ERROR");
  changes.clear();
  changes.put("_.com.datatorrent.*", "WARN");
  LoggerUtil.changeLoggersLevel(changes);
  levels = LoggerUtil.getPatternLevels();
  assertEquals(2, levels.size());
  assertEquals(levels.get("_.org.apache.*"), "WARN");
  assertNull(levels.get("_.com.datatorrent.io.fs.*"));
  assertNull(levels.get("_.com.datatorrent.io.*"));
  assertEquals(levels.get("_.com.datatorrent.*"), "WARN");
}