Guava has something similar, it's called ClassToInstanceMap.

You can read more about it in a dedicated Wiki section.

But apparently what you need is a ClassToInstanceMultimap. There is none yet, but you could file a feature request.

Answer from Sean Patrick Floyd on Stack Overflow
🌐
Oracle
docs.oracle.com › javase › tutorial › collections › implementations › map.html
Map Implementations (The Java™ Tutorials > Collections > Implementations)
If you need SortedMap operations or key-ordered Collection-view iteration, use TreeMap; if you want maximum speed and don't care about iteration order, use HashMap; if you want near-HashMap performance and insertion-order iteration, use LinkedHashMap. In this respect, the situation for Map ...
🌐
W3Schools
w3schools.com › java › java_map.asp
Java Map
The Map interface is a part of the Java Collections Framework and is used to store key-value pairs.
🌐
Oracle
docs.oracle.com › javase › tutorial › collections › interfaces › map.html
The Map Interface (The Java™ Tutorials > Collections > Interfaces)
The Map interface includes methods ... keySet, entrySet, and values). The Java platform contains three general-purpose Map implementations: HashMap, TreeMap, and LinkedHashMap....
🌐
Baeldung
baeldung.com › home › java › java collections › java map › java hashmap with different value types
Java HashMap With Different Value Types | Baeldung
January 8, 2024 - As we can see, the three types are entirely different. So first, we’ll try to put these three objects in a HashMap. To make it simple, we’ll use String values as keys. Of course, at some point, we need to read the data out from the Map and use the data. Therefore, we’ll walk through the entries in the HashMap, and for each entry, we print the value with some description. So, let’s see how we can achieve that. We know that in Java, Object is the supertype of all types.
🌐
DevGenius
blog.devgenius.io › types-of-maps-in-java-a-comprehensive-guide-0ccbd9874689
Types of Maps in Java: A Comprehensive Guide | by Techie's Spot | Dev Genius
January 22, 2024 - Java provides several map implementations, each with its own characteristics and use cases. In this comprehensive guide, we’ll explore different types of maps in Java, explain their differences, provide code examples, share best practices, and highlight key considerations to help you choose the right map for your needs.
🌐
Design Gurus
designgurus.io › home › blog › java map explained – master key-value data structures fast
Java Map Explained – Master Key-Value Data Structures Fast
August 5, 2026 - If maintaining order is important, then LinkedHashMap or TreeMap may be the better choice, depending on whether or not null values or keys are allowed. Understand the Big-O algorithm complexity.
🌐
GeeksforGeeks
geeksforgeeks.org › java › map-interface-in-java
Map Interface in Java - GeeksforGeeks
We must use a class that implements it (e.g., HashMap). ... It is part of the Java Collections Framework, and its key implementation classes include HashMap, LinkedHashMap, TreeMap, and Hashtable.
Published: August 31, 2026
Find elsewhere
🌐
DZone
dzone.com › data engineering › data › hashmap vs. treemap vs. hashtable vs. linkedhashmap
HashMap vs. TreeMap vs. HashTable vs. LinkedHashMap
March 28, 2013 - There are four . commonly used implementations of Map in Java SE: HashMap, TreeMap, Hashtable, and LinkedHashMap.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › Map.html
Map (Java Platform SE 8 )
July 21, 2026 - All general-purpose map implementation classes should provide two "standard" constructors: a void (no arguments) constructor which creates an empty map, and a constructor with a single argument of type Map, which creates a new map with the same key-value mappings as its argument.
🌐
Codecademy
codecademy.com › docs › java › map
Java | Map | Codecademy
April 30, 2022 - Learn to code in Java — a robust programming language used to create software, web and mobile apps, and more. Beginner Friendly.Beginner Friendly17 hours17 hours · MapClass<KeyDataType,ValueDataType> myMap = new MapClass<KeyDataType,ValueDataType> The MapClass is a class that implements the Map interface, and is initialized with two generic types inside angle brackets < ...
🌐
Scientech Easy
scientecheasy.com › home › blog › map in java
Map in Java - Scientech Easy
May 16, 2025 - Map interface in Java is defined in java.util.Map package. It is a part of the Java collections framework but it does not extend the collection interface. Java map interface is defined like this: ... In this syntax, K defines the type of keys and V defines the type of values.
🌐
Medium
medium.com › @reetesh043 › java-collection-map-interface-1881d9294a8d
Java Collection: Map Interface. Introduction | by Reetesh Kumar | Medium
January 25, 2024 - EnumMap: A specialized Map implementation for use with enum type keys. In Java, we must import the java.util.Map package to use Map.
🌐
Jenkov
jenkov.com › tutorials › java-collections › map.html
Java Map
If you know the type of the objects being stored in the Map it is considered good practice to always specify a generic type when declaring and creating a Java Map. The generic type helps you avoid inserting the wrong objects, and makes it easier for people reading your code to understand what kind of objects the Map contains.
🌐
Medium
medium.com › @kundansingh0619 › introduction-to-maps-in-java-internal-working-of-hashmap-67129b94c3b5
Introduction to Maps in Java & Internal working of HASHMAP | by Kundan Singh | Medium
March 29, 2025 - Configuration Settings: Mapping setting names to their values in configuration files. Java provides three primary implementations of the Map interface: HashMap, LinkedHashMap, and TreeMap.
🌐
Redisson
redisson.pro › glossary › java-map.html
What is a Java map? | Redisson
Java maps are an implementation of the map abstract data type for the Java programming language. Maps link keys with values: given a key, the map will return the associated value. Each key is unique, but the associated values may not be.
🌐
Medium
medium.com › @devlogicwrites › 5-java-map-types-that-quietly-destroy-or-boost-your-performance-34dfecba6c57
5 Java Map Types That Quietly Destroy or Boost Your Performance | by DevLogic - Engineering Thinking | Medium
January 20, 2026 - This article is not about exotic JVM flags or obscure tuning tricks. It is about five Java Map types that silently decide the fate of your performance, often without you realizing it.
🌐
Upgrad
upgrad.com › home › tutorials › software & tech › map in java
Map Interface in Java: Comprehensive Tutorial with Examples
August 14, 2025 - Master the Java Map interface with our detailed guide covering HashMap, TreeMap, and LinkedHashMap implementations, key methods, and practical code examples.
🌐
DEV Community
dev.to › wittedtech-by-harshit › a-deep-dive-into-java-maps-the-ultimate-guide-for-all-developers-oig
A Deep Dive into Java Maps: The Ultimate Guide for All Developers - DEV Community
November 12, 2024 - Implementation : Uses a Red-Black Tree (a type of balanced binary search tree). Performance : O(log n) for get, put, and remove operations. Characteristics : Sorted according to the natural order of keys or a custom Comparator. 3.4 Hashtable · Ancient History Alert : A relic from Java’s early days, synchronized and thread-safe, but with a heavy performance penalty.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-use-maps-in-java
How To Use Maps in Java | DigitalOcean
Technical tutorials, Q&A, events — This is an inclusive place where developers can find or lend support and discover new ways to contribute to the community.