### Question:
ActionComparator implements Comparator<Action> { @Override public int compare(Action arg0, Action arg1) { return ComparisonChain.start() .compare(arg0.getOrder(), arg1.getOrder(), Ordering.natural().nullsLast()) .result(); }  @Override int compare(Action arg0, Action arg1); static final ActionComparator INSTANCE; }### Answer:
@Test public void compareTest() { Action actionLess = mock(Action.class); Action actionMore = mock(Action.class); Action actionNull = mock(Action.class); when(actionLess.getOrder()).thenReturn(Integer.valueOf(3)); when(actionMore.getOrder()).thenReturn(Integer.valueOf(5)); when(actionNull.getOrder()).thenReturn(null); Assert.assertEquals(1, ActionComparator.INSTANCE.compare(actionMore, actionLess)); Assert.assertEquals(1, ActionComparator.INSTANCE.compare(actionNull, actionLess)); Assert.assertEquals(-1, ActionComparator.INSTANCE.compare(actionLess, actionMore)); Assert.assertEquals(-1, ActionComparator.INSTANCE.compare(actionLess, actionNull)); }