title: how can I relate values of generic type parameters in java Map interface?
body: <p>I don't think the title of the question will be clear, but the idea is simple. </p>
  
  <p>Suppose I have a Map type variable.</p>
  
  <pre><code>Map&lt;K,V&gt; myMap;
  </code></pre>
  
  <p>but I want to establish a relation between K and V. for example, I'd like to say that
  this Map relates Sets of some class to objets of that class. Something like:</p>
  
  <pre><code>Map&lt;Set&lt;T&gt;, T&gt; myMap;
  </code></pre>
  
  <p>but not for a specific type T. I'd like this Map to accept entries like</p>
  
  <pre><code>(Set&lt;String&gt;, String),
  (Set&lt;Integer&gt;, Integer)
  ...
  </code></pre>
  
  <p>Is there a possible declaration for myMap that allows me to have this behavior? Please let me know if I'm explaining myself wrongly or if I have a previous conceptual error. </p>