void () { final ArrayList<Integer> list1 = new ArrayList<>(Arrays.asList(arr1)); final ArrayList<Integer> list2 = new ArrayList<>(Arrays.asList(arr2)); final ArrayList<Integer> list3 = new ArrayList<>(Arrays.asList(arr3)); final Iterator<Integer> iterator = compose(Arrays.asList(list1.iterator(), list2.iterator(), list3.iterator())); int cnt = 0; while (iterator.hasNext()) { iterator.next(); if ((cnt - 2) % 5 == 0) { iterator.remove(); } ++cnt; } assertFalse(list1.contains(3)); assertFalse(list2.contains(13)); assertFalse(list3.contains(103)); }