### Question:
PmdLevelUtils { public static RulePriority fromLevel(String level) { return LEVELS_PER_PRIORITY.inverse().get(level); } private  PmdLevelUtils(); static RulePriority fromLevel(String level); static String toLevel(RulePriority priority);  }### Answer:
@Test public void should_get_priority_from_level() { assertThat(PmdLevelUtils.fromLevel("1")).isSameAs(RulePriority.BLOCKER); assertThat(PmdLevelUtils.fromLevel("2")).isSameAs(RulePriority.CRITICAL); assertThat(PmdLevelUtils.fromLevel("3")).isSameAs(RulePriority.MAJOR); assertThat(PmdLevelUtils.fromLevel("4")).isSameAs(RulePriority.MINOR); assertThat(PmdLevelUtils.fromLevel("5")).isSameAs(RulePriority.INFO); assertThat(PmdLevelUtils.fromLevel("?")).isNull(); assertThat(PmdLevelUtils.fromLevel(null)).isNull(); }