private List<Commit> createRandomCommits(Key key) {
Random random = new Random();
List<Commit> ret = new ArrayList<Commit>();
for (int count = 0; count < 5; count++) {
Commit commit = new Commit();
commit.setProject(key);
long rev = Math.abs(random.nextLong());
if (rev < HEX_10_DIGITS)
rev += HEX_10_DIGITS + 1;
commit.setRevision(Long.toString(rev, 16).substring(0, 8));
commit.setDateTime(new Date(System.currentTimeMillis()
- random.nextInt(3600000)));
commit.setMessage("random commit with long message");
commit.setAuthor("random");
ret.add(commit);
}
return ret;
}