@Override
public ExpectedCondition<Boolean> contains(final String expected) {
if (expected == null) {
throw new IllegalArgumentException("The expected string is null.");
}
return new BooleanConditionWrapper(new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver driver) {
String elementText = findElement(locator, driver).getText();
return elementText.contains(expected);
}