### Question:
TimeComparator implements Comparator<NodeEntry> { @Override public int compare(NodeEntry e1, NodeEntry e2) { long t1 = e1.getModified(); long t2 = e2.getModified(); if (t1 < t2) { return 1; } else if (t1 > t2) { return -1; } else { return 0; } }  @Override int compare(NodeEntry e1, NodeEntry e2);  }### Answer:
@Test public void test() throws InterruptedException { Node node1 = Node.instanceOf("127.0.0.1:10001"); NodeEntry ne1 = new NodeEntry(node1); Thread.sleep(1); Node node2 = Node.instanceOf("127.0.0.1:10002"); NodeEntry ne2 = new NodeEntry(node2); TimeComparator tc = new TimeComparator(); int result = tc.compare(ne1, ne2); Assert.assertEquals(1, result); }