@Test
public void testSegment_notByParticipant() {
System.out.println("segment_notByParticipant");
MessageSet messages = new MessageSet();
messages.add(new Message(0, new Date(), "Alice", "it's"));
messages.add(new Message(1, new Date(), "Bob", "cow"));
messages.add(new Message(2, new Date(), "Alice", "time"));
messages.add(new Message(3, new Date(), "Bob", "noooooooo"));
messages.add(new Message(4, new Date(), "Bob", "once"));
messages.add(new Message(5, new Date(), "Alice", "upon"));
messages.add(new Message(6, new Date(), "Bob", "a"));
messages.add(new Message(7, new Date(), "Alice", "time"));
ThresholdSegmentation instance = new ThresholdSegmentation(30, false);
SegmentSet segments = instance.segment(messages);
//Expecting 1 segment
assertEquals(1, segments.size());
Segment seg0 = segments.get(0);
assertEquals(8, seg0.getMessages().size());
for (int i = 0; i < seg0.getMessages().size(); i++) {
Message message = seg0.getMessages().get(i);
Message expectedMessage = seg0.getMessages().get(i);
assertEquals(expectedMessage, message);
}
}