We just released greenrobot-common 2.2, a small utility library that we use in almost every project. This version adds multimaps, which are absent from standard Java and Android. Unlike a regular map, multimaps allow multiple values for a single key.
We offer two implementations: ListMap allows duplicate values within a key, while SetMap does not. Our take on multimaps focuses on minimal code size. That’s why we simply build on top of a Map from Java Collections, and add some List/Set management to it. We did this by hand regularly in our project, and the chances are you have been doing the same thing. Thus, we generalized the problem, added a couple of features, and made it part of our library.
PS.: Yes, we are well aware of other libraries like Apache Commons Collections and Google Guava, which offer custom implementation of multimaps. If you already use those, you should prefer their implementation. With greenrobot-common our goals are different: we focus on minimal code size and/or performance and concentrate at solving problems we are facing regularly in the projects we do ourselves. Find out more about greenrobot-common here.
PPS.: It does not make sense to compare directly, but just to give you a sense of library sizes…
Apache Commons Collections 4.1: 734 k
Guava 19: 2.2 m
greenrobot-common 2.2: 56 k