title: Why is my import of the containsString method not working?
body: <p>I've written the simple Java script below in order to learn more about TDD, IntelliJ and Java itself.  </p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  
  import org.junit.Before;
  import org.junit.Test;
  
  import static org.hamcrest.CoreMatchers.containsString;
  import static org.hamcrest.CoreMatchers.is;
  import static org.junit.Assert.assertThat;
  import static org.junit.matchers.JUnitMatchers.both;
  
  public class JUnit_Dummy {
  
    private StringJoiner joiner;
    private List&lt;String&gt; strings;
  
    @Before
    public void setUp() throws Exception {
      strings = new ArrayList&lt;String&gt;();
      joiner = new StringJoiner();
    }
  ....
  
    @Test
    public void shouldContainBothStringsWhenListIsTwoStrings() {
      strings.add("one");
      strings.add("two");
      assertThat(joiner.join(strings),
          both(containsString("A")).
              and(containsString("B")));
    }
  
  }
  _____________
  
  import java.util.List;
  
  public class StringJoiner {
    public String join(List&lt;String&gt; strings) {
      if(strings.size() &gt; 0) {
        return (strings.get(0);
      }
      return "";
    }
  }
  </code></pre>
  
  <p>I'm trying to use the "containsString" method inside an assertion, but IntelliJ keeps telling me that it "cannot resolve method 'containsString(java.lang.String)".  This despite the fact that the jUnit docs (<a href="http://junit.sourceforge.net/javadoc/org/junit/matchers/JUnitMatchers.html#containsString%28java.lang.String%29">http://junit.sourceforge.net/javadoc/org/junit/matchers/JUnitMatchers.html#containsString(java.lang.String)</a>) tell me that this method does accept a String parameter.  </p>
  
  <p>I've tried swapping out various import statements, including the following:</p>
  
  <pre><code>import static org.hamcrest.Matcher.containsString;
  import static org.hamcrest.Matcher.*;
  import static org.hamcrest.CoreMatchers.*;
  </code></pre>
  
  <p>The best that I get is a greyed-out import statement telling me that the import statement is unused.  Not sure what the problem is, any help would be appreciated.</p>
  
  <p>UPDATE:</p>
  
  <p>Here is the exact compiler error:</p>
  
  <pre><code>java: cannot find symbol
    symbol:   method containsString(java.lang.String)
    location: class JUnit_Dummy
  </code></pre>