void () { final ArrayList<Integer> list1 = new ArrayList<>(Collections.singletonList(1)); final Iterator<Integer> iterator = compose(Collections.singletonList(list1.iterator())); try { iterator.remove(); fail(); } catch (IllegalStateException e) { // ok } }