Implementation of a bag (multiset) using a List in Java