MapimmutableMap = ImmutableMap.of("key1", 123, "key2", 456);
Mapmap = Maps.newHashMap(); map.put("key", "value");
BiMapOverall, the com.google.common.collect Maps package library is a powerful tool for working with maps in Java, with many useful functions and classes for developers.biMap = HashBiMap.create(); biMap.put("one", 1); biMap.put("two", 2); biMap.inverse().get(1); // returns "one"