title: Why == for Integer.valueOf(500) returns false but true for 5?
body: <pre><code>System.out.println(Integer.valueOf(5) == Integer.valueOf(5));
  System.out.println(Integer.valueOf(500) == Integer.valueOf(500));
  </code></pre>
  
  <p>The output is </p>
  
  <pre><code>true
  false
  </code></pre>
  
  <p>Why does the first line returns true but the second line returns false? What's the trick here since both are calling <code>valueOf()</code> on <code>Integer</code> class. </p>