title: Inheritance Issues
body: <p>I implemented the Following:</p>
  
  <pre><code>public class MultiMapClass&lt;K,V&gt; implements MultiMap&lt;K,V&gt; {
  
      private Map&lt;K, TreeSet&lt;V&gt;&gt; multiMap= new HashMap&lt;K,TreeSet&lt;V&gt;&gt;();
  
  
      public MultiMapClass(){
  
  }
  
  public void put(K key, V value){
      multiMap.get(key).add(value);
  }
  
  public Set&lt;V&gt; get(K key){
      return multiMap.get(key);
  }
  }
  
  
  public class TaggedMultiMapClass&lt;K,T,V&gt;  extends MultiMapClass&lt;K,V&gt; implements TaggedMultiMap&lt;K, V, T&gt; {
  
  private Map&lt;K,HashMap&lt;V,T&gt;&gt; tags = new HashMap&lt;K,HashMap&lt;V,T&gt;&gt;();
  
  public TaggedMultiMapClass(){
  
  
  }
  
  @Override
  public void put(K key, V value, T tag) {
      tags.get(key).put(value,tag);
  
  
  
  }
  
  @Override
  public T getTag(K key, V val) {
   return tags.get(key).get(val);
  }
  
  @Override
  public T getTag(TaggedMultiMap.Entry&lt;K, V&gt; entry) {
      return tags.get(entry.getKey()).get(entry.getValue());
  }
  
  @Override
  public Set&lt;T&gt; getTags(K key) {
      return (Set&lt;T&gt;) tags.get(key).values(); }
  </code></pre>
  
  <p>}</p>
  
  <p>Taggedmultimap suppose be <strong>a multimap</strong>, but I just don't feel right about what I did.
  It looks like I just have two different classes with two different representations and no connection at all. If I decide that one object extends from other, does the other have to use some methods of the first? I can't execute the tags thing( each value of the value set has to have a tag of itself) with using  <code>Map&lt;K, TreeSet&lt;V&gt;&gt; multiMap= new HashMap&lt;K,TreeSet&lt;V&gt;&gt;()</code> and I don't need <code>Map&lt;K,HashMap&lt;V,T&gt;&gt; tags = new HashMap&lt;K,HashMap&lt;V,T&gt;&gt;();</code> in order to use multimap. What should I do?</p>