Using generics
Avoiding concurrent modification exception