SegmentSet segments = instance.segment(messages);
//Expecting 5 segments
assertEquals(5, segments.size());
Segment seg0 = segments.get(0);
Segment seg1 = segments.get(1);
Segment seg2 = segments.get(2);
Segment seg3 = segments.get(3);
Segment seg4 = segments.get(4);
assertEquals(1, seg0.getMessages().size()); //Alice
assertEquals(1, seg1.getMessages().size()); //Alice
assertEquals(2, seg2.getMessages().size()); //Alice, Alice
assertEquals(2, seg3.getMessages().size()); //Bob, Bob
assertEquals(2, seg4.getMessages().size()); //Bob, Bob
assertEquals(messages.get(0), seg0.getMessages().get(0));
assertEquals(messages.get(5), seg1.getMessages().get(0));
assertEquals(messages.get(6), seg2.getMessages().get(0));
assertEquals(messages.get(1), seg3.getMessages().get(0));
assertEquals(messages.get(3), seg4.getMessages().get(0));
}