Off the top of my head, lists allow duplicates. You could quickly implement a UniqueArrayList
and override all the add
/ insert
functions to check for contains()
before you call the inherited methods. For personal use, you could only implement the add
method you use, and override the others to throw an exception in case future programmers try to use the list in a different manner.