public void testOfferWithTruncation()
{
RepairLog rl = new RepairLog();
// add m1
VoltMessage m1 = truncInitMsg(0L, 1L);
rl.deliver(m1);
assertEquals(2, rl.contents(1L, false).size());
// add m2
VoltMessage m2 = truncInitMsg(0L, 2L);
rl.deliver(m2);
assertEquals(3, rl.contents(1L, false).size());
// trim m1. add m3
VoltMessage m3 = truncInitMsg(1L, 3L);
rl.deliver(m3);
assertEquals(3, rl.contents(1L, false).size());
assertEquals(m2, rl.contents(1L, false).get(1).getPayload());
assertEquals(2L, rl.contents(1L, false).get(1).getHandle());
assertEquals(m3, rl.contents(1L, false).get(2).getPayload());