nhojpatrick commented on a change in pull request #282:
URL:
https://github.com/apache/commons-collections/pull/282#discussion_r818415380
##########
File path:
src/test/java/org/apache/commons/collections4/iterators/ObjectArrayListIteratorTest.java
##########
@@ -101,15 +102,8 @@ public void testListIteratorSet() {
// a call to set() before a call to next() or previous() should throw
an IllegalStateException
iter = makeArrayListIterator((E[]) testArray);
- try {
- iter.set((E) "should fail");
- fail("ListIterator#set should fail if next() or previous() have
not yet been called.");
- } catch (final IllegalStateException e) {
- // expected
- } catch (final Throwable t) { // should never happen
- fail(t.toString());
- }
-
+ ListIterator<E> finalIter = iter;
+ assertThrows(IllegalStateException.class, () -> finalIter.set((E)
"should fail"));
Review comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]