title: Check if strings on an arraylist are the same?
body: <p>CandidateList is a list that consists of names of candidates. And ballot is a  list of strings. I want to check if the first name on the ballot list is the same to any of the names on the candidateList. If not then I want to check the next string on ballot and see if that string is the same to any of the names on the candidateList. And etc... </p>
  
  <pre><code>/**
       * @param candidateList a list of candidate names
       * @return the name of the first choice candidate for this Ballot from those
       * in candidateList
       */
      public String firstChoiceFrom(ArrayList&lt;String&gt; candidateList) {
  
          String firstChoice = "";
          String candidate = "";
          for (int can = 0; can &lt; candidateList.size(); can++) {
  
              String bal = ballot.get(can); // gets next ballot
              candidate = candidateList.get(can); // gets next candidate
               while (!candidate.equals(bal))
               {
  
               }
              //checks to see whether the first name on the ballot
              if (candidate.equals(bal)) {        
                  return candidate;
              } 
  
          }
  </code></pre>