I have an assertion that checks if a string is present in the currently selected text:
import static org.junit.Assert.assertThat;
import static org.hamcrest.Matchers.containsString;
assertThat(latest.getText(), containsString(targetString));
But I can't find the right way to write an assertion that checks if a string is NOT contained in the text.
I tried
assertThat(latest.getText(), not(containsString(targetString)));
but get an error
the method not(Matcher <String>) is undefined
What is the way to do this?