title: How to implement a Map with multiple keys?
body: <p>I need a data structure which behaves like a Map, 
  but uses multiple (differently-typed) keys to access its values.<br>
  <em>(Let's not be too general, let's say <strong>two</strong> keys)</em></p>
  
  <p><strong>Keys are guaranteed to be unique.</strong></p>
  
  <p>Something like:</p>
  
  <pre><code>MyMap&lt;K1,K2,V&gt; ...
  </code></pre>
  
  <p>With methods like:</p>
  
  <pre><code>getByKey1(K1 key)...
  getByKey2(K2 key)...
  containsKey1(K1 key)...
  containsKey2(K2 key)...
  </code></pre>
  
  <p><strong>Do you have any suggestions?</strong></p>
  
  <p>The only thing I can think of is:<br>
  Write a class which uses two Maps internally.</p>
  
  <p><strong>EDIT</strong>
  Some people suggest me to use a <strong>tuple</strong>, a <strong>pair</strong>, or similar as a key for
  Java's Map, but this <strong>would not work</strong> for me:<br>
  I have to be able, as written above, to search values by only one of the two keys specified.<br>
  Maps use hash codes of keys and check for their equality.</p>