PriorityDropDown implements IsWidget { public Priority resolvePriority(int priority) { if (priority < -5) { return Priority.VERY_LOW; } if (priority < 0) { return Priority.LOW; } if (priority == 0) { return Priority.NORMAL; } if (priority <= 5) { return Priority.HIGH; } return Priority.VERY_HIGH; } @Inject  PriorityDropDown(LiveSearchDropDown liveSearchDropDown); @Override Widget asWidget(); String getPriorityName(int priority); int getSelectedPriority(); void setSelectedPriority(int ordinal); void setWidth(int minWidth); void setOnChange(Command onChange); void clear(); Priority resolvePriority(int priority);  }
@Test public void testResolvePriority() { assertEquals(priorityDropDown.getPriorityName(-10), "1"); assertEquals(priorityDropDown.getPriorityName(-5), "2"); assertEquals(priorityDropDown.getPriorityName(-1), "2"); assertEquals(priorityDropDown.getPriorityName(0), "3"); assertEquals(priorityDropDown.getPriorityName(1), "4"); assertEquals(priorityDropDown.getPriorityName(5), "4"); assertEquals(priorityDropDown.getPriorityName(6), "5"); }