AlertLevelConverter { public static Level toLevel(final AlertLevel alert) { switch (alert) { case SEVERE: return Level.FATAL; case ERROR: return Level.ERROR; case WARNING: return Level.WARN; case NONE: return Level.OFF; } throw new IllegalArgumentException("No matching Log4J2 Level for " + alert + "."); }  static boolean hasAlertLevel(final Level level); static Level toLevel(final AlertLevel alert); static AlertLevel fromLevel(final Level level);  }
@Test public void toLevel_AlertSevere_returnsLevelFatal() { assertThat(toLevel(AlertLevel.SEVERE)).isEqualTo(Level.FATAL); }
@Test public void toLevel_AlertError_returnsLevelFatal() { assertThat(toLevel(AlertLevel.ERROR)).isEqualTo(Level.ERROR); }
@Test public void toLevel_AlertWarning_returnsLevelFatal() { assertThat(toLevel(AlertLevel.WARNING)).isEqualTo(Level.WARN); }
@Test public void toLevel_AlertOff_returnsLevelFatal() { assertThat(toLevel(AlertLevel.NONE)).isEqualTo(Level.OFF); }