void () { Iterator<Object> iterator = myWeakList.iterator(); assertFalse(iterator.hasNext()); try { iterator.next(); fail("must not allow to next"); } catch (NoSuchElementException ignored) { } try { iterator.remove(); fail("must not allow to remove"); } catch (NoSuchElementException ignored) { } }