TestCase.assertFalse(hi.hasNext());
}
@Test
public void test_overflow_history() {
final History his = new History();
// NOTE: Assumes a fixed history size of 100
for (int i = -20; i < 100; i++) {
his.append("cmd" + i);
}
Iterator<String> hi = his.getHistory();
for (int i = 0; i < 100; i++) {
TestCase.assertEquals("cmd" + i, hi.next());
}
TestCase.assertFalse(hi.hasNext());
}