import com.google.common.collect.TreeMultimap;
import java.util.SortedSet;
import java.util.ArrayList;
import java.util.Collection;
class HelloWorld {
public static void main
(String[] args
) { // Create an instance of TreeMultimap
TreeMultimap
<Double, Integer
> multimap
= TreeMultimap.
create();
// Add some key-value pairs
multimap.put(0.0, 7);
multimap.put(5.6, 2);
multimap.put(2.3, 3);
multimap.put(1.2, 4);
// Get a Collection of all values
Collection<Integer> values = multimap.values();
// Convert the Collection to a SortedSet
ArrayList<Integer> sortedValues = new ArrayList<>(values);
// Print the SortedSet
System.
out.
println(sortedValues
); }
}
aW1wb3J0IGNvbS5nb29nbGUuY29tbW9uLmNvbGxlY3QuVHJlZU11bHRpbWFwOwppbXBvcnQgamF2YS51dGlsLlNvcnRlZFNldDsKaW1wb3J0IGphdmEudXRpbC5BcnJheUxpc3Q7CmltcG9ydCBqYXZhLnV0aWwuQ29sbGVjdGlvbjsKCmNsYXNzIEhlbGxvV29ybGQgewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIC8vIENyZWF0ZSBhbiBpbnN0YW5jZSBvZiBUcmVlTXVsdGltYXAKICAgICAgICBUcmVlTXVsdGltYXA8RG91YmxlLCBJbnRlZ2VyPiBtdWx0aW1hcCA9IFRyZWVNdWx0aW1hcC5jcmVhdGUoKTsKCiAgICAgICAgLy8gQWRkIHNvbWUga2V5LXZhbHVlIHBhaXJzCiAgICAgICAgbXVsdGltYXAucHV0KDAuMCwgNyk7CiAgICAgICAgbXVsdGltYXAucHV0KDUuNiwgMik7CiAgICAgICAgbXVsdGltYXAucHV0KDIuMywgMyk7CiAgICAgICAgbXVsdGltYXAucHV0KDEuMiwgNCk7CgogICAgICAgIC8vIEdldCBhIENvbGxlY3Rpb24gb2YgYWxsIHZhbHVlcwogICAgICAgIENvbGxlY3Rpb248SW50ZWdlcj4gdmFsdWVzID0gbXVsdGltYXAudmFsdWVzKCk7CgogICAgICAgIC8vIENvbnZlcnQgdGhlIENvbGxlY3Rpb24gdG8gYSBTb3J0ZWRTZXQKICAgICAgICBBcnJheUxpc3Q8SW50ZWdlcj4gc29ydGVkVmFsdWVzID0gbmV3IEFycmF5TGlzdDw+KHZhbHVlcyk7CgogICAgICAgIC8vIFByaW50IHRoZSBTb3J0ZWRTZXQKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oc29ydGVkVmFsdWVzKTsKICAgIH0KfQ==