title: confusion about HashMap's method containsValue
body: <p>I'm trying to find a simplified version of my method and I wanted to know if you have a better opinion.</p>
  
  <p>Basically I have a HashMap that stores key-value as String-String[]</p>
  
  <p>I would like to have a method that finds out if a new inserted String[]-value, contains a String that is already present in already stored String[]-value.</p>
  
  <p>What I have written "and apparently works fine" is the following method:</p>
  
  <pre><code>static Map&lt;String,String[]&gt; myMap=new HashMap&lt;String,String[]&gt;();
  
      public static boolean kijkContains(String[] syn){
  
  for(String s:myMap.keySet()){
  
      String[]temp=myMap.get(s);
  
      for(int i=0; i&lt;temp.length; i++){
  
          for(int k=0; k&lt;syn.length; k++){
  
              if(temp[i].equals(syn[k])){
  
                  return true;
              }
          }
      }
    }
  return false;
  }
  </code></pre>
  
  <p>My doubts are about the number of loops, it is obviously a high memory-consuming method, and I was wondering if you can think of any better version.</p>
  
  <p>I have tried with Map's containsValue() method but since that method sees as value the String[] instead of reading through the array, I cant really use it as comparator.</p>