A more sophisticated library for tuples in Java is available, and it is called JavaTuples (available at http://www.javatuples.org/). It contains things such as, but not limited to, the following:
The library can be easily installed by adding dependencies to the app/build.gradle file:
The use of the library is simple and very simple to the android.util.Pair, as shown:
Observable.just("UserID1", "UserID2", "UserID3") .map(id -> Triplet.with(id, id + "-access-token", "third-value")) .subscribe(triplet -> log(triplet.getValue0(), triplet.getValue1() + triplet.getValue2()));
However, the library has a much higher overhead in memory compared to android.util.Pair, because ...