@Test(dataProvider="createTimer")
public void testHighestDelivered(TimeScheduler timer) throws Exception {
try {
NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 0, timer);
win.add(1, new Message());
win.add(2, new Message());
win.add(3, new Message());
win.add(4, new Message());
check(win, 0, 4, 0);
win.add(10, new Message());
check(win, 0, 10, 0);
System.out.println("win: " + win);
win.add(9, new Message());
win.add(7, new Message());
win.add(8, new Message());
win.add(6, new Message());
win.add(5, new Message());
System.out.println("win: " + win);
check(win, 0, 10, 0);
while((win.remove()) != null) ;
check(win, 0, 10, 10);
win.stable(5);
System.out.println("win: " + win);
check(win, 5, 10, 10);
win.stable(10);
System.out.println("win: " + win);
check(win, 10, 10, 10);
}
finally {
timer.stop();