title: Java contains doesn't work as expected because "someString" != "someString"
body: <p>I want check whether a String value <code>val</code> is contained within a List of Strings lets call it stringList.</p>
  
  <p>I am doing this</p>
  
  <pre><code>if(stringList.contains(val)){
    System.out.println("The value is in there");
  }
  else{
    System.out.println("There's no such value here");
  }
  </code></pre>
  
  <p>But it always seems to be that the value is not included. Is this because two String values that have the same characters are not actually equal? For a "home-made" class I could implement hashCode() and equals() and fix this, what can I do for String data?</p>
  
  <p>EDIT: </p>
  
  <p>The way I am getting val is outlined here:</p>
  
  <pre><code>List&lt;String&gt; stringList = new ArrayList&lt;String&gt;();
      stringList.add("PDT");
  stringList.add("LDT");
  stringList.add("ELNE");
  
  String myFile = "/folder/myFile";
  InputStream input = new FileInputStream(myFile);
  CSVReader reader = new CSVReader(new InputStreamReader(input), ',','"', 1);
  String[] nextLine;
  try {
      while ((nextLine = reader.readNext()) != null) {
      if (nextLine != null) {
          if (nextLine[6] != null){
            String val = nextLine[6];
              if(stringList.contains(val)){
              System.out.println("Success");
              }
          }
      }
  }
  </code></pre>