I have a structure
You can use Guava Multiset in order to achieve what you want.
In Android Studio you just need to add the following dependancy to your
Then you just need to declare a
Multiset of your class, like this:
Multiset<A> multiset = HashMultiset.create(); multiset.add(new A(1.5, "a"));
If you take a look at the docs the available methods should allow you to do what you need.