title: ConcurrentHashMap foreach loop problem
body: <p>I have a concurrenthashmap called users. I have user objects in it with some integer keys that is not id. I want to find the user with a given id. Therefore, I check all elements of hashmap and return the user object if it is present. Here is my code :</p>
  
  <pre><code>    for(User u : users.values()) {
          logger.error("u.getId() : " + u.getId());
          logger.error("id : " + id );
          if( u.getId() == id ) {
              logger.error("match");
              return u;
          }
      }
      logger.error("Not found: id:" + id);
      for(User u : users.values()) {
          logger.error(u.getPos() + ". user: " + u.getId());
      }
  </code></pre>
  
  <p>However even tough my u.getId() and id are the same I cannot see "match" at my logs. </p>
  
  <p>213 matches but It can not enter the following if statement. 
  here are my logs: </p>
  
  <p><img src="https://i.stack.imgur.com/ijSG0.png" alt="enter image description here"></p>
  
  <p>What do you think about it?</p>