Program: 17387
Project: 17387
Buggy source:
@Test public void getIteratorTestMonthly() throws RhombusException {
  Long millistamp=946740000000L;
  millistamp=System.currentTimeMillis();
  System.out.println(millistamp);
  UUID startingUUID=UUIDs.startOf(millistamp);
  System.out.println("String_Node_Str" + startingUUID + "String_Node_Str"+ UuidUtil.getDateFromUUID(startingUUID)+ "String_Node_Str");
  TimebasedShardingStrategy shardingStrategy=new ShardingStrategyMonthly();
  int numberPerShard=16;
  long totalNumberOfObjects=10000L;
  FakeIdRange subject=new FakeIdRange(CField.CDataType.TIMEUUID,startingUUID,totalNumberOfObjects,(long)numberPerShard,shardingStrategy);
  Iterator<FakeIdRange.IdInRange> it=subject.getIterator(CObjectOrdering.ASCENDING);
  long counter=0;
  int lastmonth=0;
  int countSinceChange=numberPerShard;
  while (it.hasNext()) {
    counter++;
    FakeIdRange.IdInRange id=it.next();
    Date dt=UuidUtil.getDateFromUUID((UUID)id.getId());
    if (dt.getMonth() == lastmonth) {
      assert(countSinceChange < numberPerShard);
      countSinceChange++;
    }
 else {
      assertEquals(numberPerShard,countSinceChange);
      countSinceChange=1;
    }
    ;
    lastmonth=dt.getMonth();
    System.out.println("String_Node_Str" + counter);
    System.out.println("String_Node_Str" + id.getCounterValue());
    System.out.println("String_Node_Str" + subject.getCounterAtId(id.getId()));
    System.out.println(counter + "String_Node_Str" + UuidUtil.getDateFromUUID((UUID)id.getId()).toString());
  }
  assertEquals(totalNumberOfObjects,counter);
}

Fixed version (ground truth):
@Test public void getIteratorTestMonthly() throws RhombusException {
  Long millistamp=946740000000L;
  millistamp=System.currentTimeMillis();
  System.out.println(millistamp);
  UUID startingUUID=UUIDs.startOf(millistamp);
  System.out.println("String_Node_Str" + startingUUID + "String_Node_Str"+ UuidUtil.getDateFromUUID(startingUUID)+ "String_Node_Str");
  TimebasedShardingStrategy shardingStrategy=new ShardingStrategyMonthly();
  int numberPerShard=10;
  long totalNumberOfObjects=2000;
  FakeIdRange subject=new FakeIdRange(CField.CDataType.TIMEUUID,startingUUID,totalNumberOfObjects,(long)numberPerShard,shardingStrategy);
  Iterator<FakeIdRange.IdInRange> it=subject.getIterator(CObjectOrdering.ASCENDING);
  long counter=0;
  int lastmonth=-1;
  int countSinceChange=0;
  while (it.hasNext()) {
    System.out.println("String_Node_Str");
    counter++;
    FakeIdRange.IdInRange id=it.next();
    DateTime dt=UuidUtil.getDateFromUUID((UUID)id.getId());
    System.out.println("String_Node_Str" + dt.getMonthOfYear());
    System.out.println("String_Node_Str" + countSinceChange);
    if (lastmonth == -1) {
      countSinceChange=1;
      lastmonth=dt.getMonthOfYear();
    }
    if (dt.getMonthOfYear() == lastmonth) {
      countSinceChange++;
    }
 else {
      assertEquals(numberPerShard,countSinceChange);
      countSinceChange=1;
    }
    ;
    lastmonth=dt.getMonthOfYear();
    System.out.println("String_Node_Str" + counter);
    System.out.println("String_Node_Str" + id.getCounterValue());
    System.out.println("String_Node_Str" + subject.getCounterAtId(id.getId()));
    assertEquals(subject.getCounterAtId(id.getId()),id.getCounterValue());
    System.out.println(counter + "String_Node_Str" + UuidUtil.getDateFromUUID((UUID)id.getId()).toString());
  }
  assertEquals(totalNumberOfObjects,counter);
}