| | import java.util.ListIterator; |
| | |
| | -import static org.junit.jupiter.api.Assertions.assertEquals; |
| | -import static org.junit.jupiter.api.Assertions.assertTrue; |
| | +import static org.junit.jupiter.api.Assertions.*; |
| | |
| | /** |
 |
| | |
| | assertEquals( iterator.previous(), list.get( list.size() - 1 ) ); |
| | + } |
| | + |
| | + @Test |
| | + public void test_Empty_Next_Exception() { |
| | + final var list = List.of(); |
| | + final var iterator = CyclicIterator.of( list ); |
| | + assertThrows( ArrayIndexOutOfBoundsException.class, iterator::next ); |
| | + } |
| | + |
| | + @Test |
| | + public void test_Empty_Previous_Exception() { |
| | + final var list = List.of(); |
| | + final var iterator = CyclicIterator.of( list ); |
| | + assertThrows( ArrayIndexOutOfBoundsException.class, iterator::previous ); |
| | } |
| | } |