withoutItem

fun <T> ArrayList<T>.withoutItem(item: T): ArrayList<T>

Gets a clone of an ArrayList without a given item

Solves concurrent modification problems - everyone who had a reference to the previous arrayList can keep using it because it hasn't changed

fun <T> HashSet<T>.withoutItem(item: T): HashSet<T>

Gets a clone of a HashSet without a given item

Solves concurrent modification problems - everyone who had a reference to the previous hashSet can keep using it because it hasn't changed