I used AbstractMap.SimpleEntry and AbstractMap.SimpleImmutableEntry when need to store pairs (like size and object collection).
This piece from my production code:
public Map<L1Risk, Map.Entry<int[], Map<L2Risk, Map.Entry<int[], Map<L3Risk, List<Event>>>>>>
getEventTable(RiskClassifier classifier) {
Map<L1Risk, Map.Entry<int[], Map<L2Risk, Map.Entry<int[], Map<L3Risk, List<Event>>>>>> l1s = new HashMap<>();
Map<L2Risk, Map.Entry<int[], Map<L3Risk, List<Event>>>> l2s = new HashMap<>();
Map<L3Risk, List<Event>> l3s = new HashMap<>();
List<Event> events = new ArrayList<>();
...
map.put(l3s, events);
map.put(l2s, new AbstractMap.SimpleImmutableEntry<>(l3Size, l3s));
map.put(l1s, new AbstractMap.SimpleImmutableEntry<>(l2Size, l2s));
}
Code looks complicated but instead of Map.Entry you limited to array of object (with size 2) and lose type checks...