Use assertThrows()

This commit is contained in:
Gary Gregory 2024-07-26 10:02:29 -04:00
parent 6c2e479630
commit b1571cb080
1 changed files with 1 additions and 4 deletions

View File

@ -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;
} }