PartitionIterators { public static PartitionIterator ascending(ObjectGrid og) { return ascending(og, 0); }  static PartitionIterator ascending(ObjectGrid og); static PartitionIterator ascending(ObjectGrid og, int start); static PartitionIterator descending(ObjectGrid og); static PartitionIterator descending(ObjectGrid og, int end); static PartitionIterator range(ObjectGrid og, int start, int end); static int getPartitionSize(ObjectGrid og);  }
@Test public void testAscending() throws Exception { PartitionIterator itr = PartitionIterators.ascending(ogclient); int matchingPartiton = 0; while (itr.hasNext()) { Assert.assertEquals("Wrong partition", matchingPartiton++, itr.next()); } Assert.assertEquals("Wrong end", 13, matchingPartiton); itr.reset(); Assert.assertEquals("Reset failed", 0, itr.next()); }
@Test public void testAscendingWithStart() throws Exception { PartitionIterator itr = PartitionIterators.ascending(ogclient, 5); int matchingPartiton = 5; while (itr.hasNext()) { Assert.assertEquals("Wrong partition", matchingPartiton++, itr.next()); } Assert.assertEquals("Wrong end", 13, matchingPartiton); itr.reset(); Assert.assertEquals("Reset failed", 5, itr.next()); }