In a package coll.MapSet, implement a new class MapSet<K,V> that extends AbstractMap<K, HashSet<V>> andimplements Iterable<V> where K represents a generic key, andV represents a generic value:
public class MapSet<K, V> extends AbstractMap<K, HashSet<V>> implements Iterable<V>
The purpose of this class is to store a dictionary of keys K toHashSet<V> objects.
Methods
Only three methods are required, but you may choose to addadditional helper methods.
addValue
Implement addValue such that calling this method adds the givenvalue to the HashSet associated with the given key. This methodmust have the following signature:
public void addValue(K, V)
iterator
Implement the iterator such that only values V are traversed.Values are traversed first in descending
PayPal Gateway not configured
PayPal Gateway not configured