I have a Treemap in pairs and need to find a specific value, locate its position (index) and do some calculations. The for loop did find the specific value, but it loops repeatedly based on System.out.println outputs. Is there any way just to return myValue once the if statement satisfies without continuing looping?

```
                   double myValue;

                   for (Map.Entry<Double, String> entry : treeMap1.entrySet()) {
                             double key = entry.getKey();
             String value = entry.getValue();
                System.out.printf("%s : %s\n", key, value);
                            System.out.println("Current value is: " + value);

                  //Locate specific values
              for (int pos=0; pos<treeMap1.size(); pos++) {

                 if (value.contains("abc")) 
                  { myValue = (double) 1/pos+1;
                   System.out.println("Current value is: " + value);
                   System.out.println("Current pos value is: " + pos);
                   System.out.println("Current my value is: " + myValue);}

         } }

```