Use assertThrows()
This commit is contained in:
parent
6c2e479630
commit
b1571cb080
|
@ -157,10 +157,7 @@ public abstract class AbstractIteratorTest<E> extends AbstractObjectTest {
|
||||||
|
|
||||||
if (!supportsRemove()) {
|
if (!supportsRemove()) {
|
||||||
// check for UnsupportedOperationException if not supported
|
// check for UnsupportedOperationException if not supported
|
||||||
try {
|
assertThrows(UnsupportedOperationException.class, it::remove);
|
||||||
it.remove();
|
|
||||||
} catch (final UnsupportedOperationException ex) {
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue