title: Printing Common Values of Two Arrays
body: <p>I am working on a java project and need to print common values between two arrays.</p>
  
  <p>I have printed both arrays in their sorted order before hand and they both look good (containing all values they should). However, when I follow the simplest of algorithms (see below) I do not find all the common values even though I can manually see in the print out of the two arrays without comparison that there should be more values printed after executing the below:</p>
  
  <pre><code>        for(int i=0; i&lt;fibList.size(); i++)
          {
              for(int j=0; j&lt;primeList.size(); j++)
              {
                  if(fibList.get(i) == primeList.get(j))
                  {
                      System.out.print(" " + fibList.get(i));
                      break;
                  }
              }
          }
  </code></pre>
  
  <p>Please let me know what you think. Hopefully this is just a simple error.</p>