title: How to get key depends on value in map of map
body: <p>i have the following data:</p>
  <p>how can i get the key if i put the value to as argument?</p>
  <pre><code>Test1(stringtest2Map={de=Test2(name=aa, stringStringMap={alex=sven, serdar=alo})})
  </code></pre>
  <blockquote>
  <p>for example if internalName= &quot;alo&quot; then it should returns serdar if =
  &quot;sven&quot; then should returns alex.</p>
  </blockquote>
  <p>my try:</p>
  <pre><code> Test2 test2 = new Test2();
      test2.name = &quot;aa&quot;;
      Map&lt;String, String&gt; map = new HashMap&lt;&gt;();
      map.put(&quot;alex&quot;, &quot;sven&quot;);
      map.put(&quot;serdar&quot;, &quot;alo&quot;);
      test2.stringStringMap = map;
      Test1 test1 = new Test1();
      Map&lt;String, Test2&gt; map1 = new HashMap&lt;&gt;();
      map1.put(&quot;de&quot;, test2);
      test1.stringtest2Map = map1;
  
      System.out.println(test1.toString());
  
      String internalName = &quot;alo&quot;;
      String firstName =
          test1.stringtest2Map.values().stream()
              .map(e -&gt; e.stringStringMap.get(internalName))
              .findFirst()
              .orElse(null);
      System.out.println(firstName);
  
  
  
    public class Test1 {
        public Map&lt;String, Test2&gt; stringtest2Map;
      }
  
  
  
   public class Test2 {
        public String name;
        public Map&lt;String, String&gt; stringStringMap;
      }
  </code></pre>
  <p>but it does not work.</p>