CyclicIteration implements Iterable<Map.Entry<K, V>> { public CyclicIteration(NavigableMap<K, V> navigablemap, K startingkey) { if (navigablemap == null || navigablemap.isEmpty()) { this.navigablemap = null; this.tailmap = null; } else { this.navigablemap = navigablemap; this.tailmap = navigablemap.tailMap(startingkey, false); } } CyclicIteration(NavigableMap<K, V> navigablemap, K startingkey); @Override Iterator<Map.Entry<K, V>> iterator();  }
@Test public void testCyclicIteration() throws Exception { for (int n = 0; n < 5; n++) { checkCyclicIteration(n); } }