int commitCount = 50;
final List<RevCommit> commits = new ArrayList<RevCommit>(commitCount);
for (int i = 0; i < commitCount; i++)
commits.add(add("file.txt", "revision " + i));
CommitFinder service = new CommitFinder(testRepo);
CommitListFilter bucket = new CommitListFilter();
CommitLimitFilter limit = new CommitLimitFilter(10);
limit.setStop(true);
CommitCursorFilter cursor = new CommitCursorFilter(new AndCommitFilter(
limit, bucket));
service.setFilter(cursor);
int chunks = 0;
RevCommit commit = CommitUtils.getHead(new FileRepository(testRepo));
while (commit != null) {
service.findFrom(commit);
assertEquals(limit.getLimit(), bucket.getCommits().size());
commits.removeAll(bucket.getCommits());
commit = cursor.getLast();
cursor.reset();
chunks++;