An iterator owns its current traversal position. Call next before remove, then let Iterator.remove remove that returned item. Removing directly from the collection during an ordinary iterator traversal can invalidate it. A forward index loop also needs care after removal because the following item shifts into the current position.
Comparable defines a type's natural order. Comparator supplies an order for a particular report, including secondary keys when the first key ties. Use Integer.compare rather than subtraction, which can overflow. For sorted sets and maps, comparison returning zero identifies an existing key, so an incomplete tie breaker can silently collapse distinct records. An enum solves a different problem: it limits state values. The final exercise uses enum states and validates each transition so paying, shipping and canceling can't happen in an invalid order.