### Question:
TextsContainCondition extends Condition<List<WebElement>> { @Override public boolean apply(List<WebElement> elements) { List<String> elementsTexts = webElementConverter.getTextsFrom(elements); if (texts.length > elementsTexts.size()) return false; List<String> actualTexts = ignoreCase ? elementsTexts.stream().map(String::toLowerCase).collect(Collectors.toList()) : elementsTexts; List<String> expectedTexts = ignoreCase ? Arrays.stream(texts).map(String::toLowerCase).collect(Collectors.toList()) : Arrays.stream(texts).collect(Collectors.toList()); return CollectionUtils.intersection(expectedTexts, actualTexts).size() == expectedTexts.size(); } TextsContainCondition(final String... texts);  TextsContainCondition(final boolean ignoreCase, final String... texts);   TextsContainCondition(final WebElementConverter webElementConverter, final boolean ignoreCase, final String... texts); @Override boolean apply(List<WebElement> elements); @Override String toString();  }### Answer:
@Test public void shouldMatchConditionWhenTextsContainValues() { when(mockWebElementConverter.getTextsFrom(mockElements)).thenReturn(asList("b", "text", "a")); TextsContainCondition condition = new TextsContainCondition(mockWebElementConverter, false, "a", "b", "text"); assertThat(condition.apply(mockElements), equalTo(true)); }
@Test public void shouldMatchConditionIgnoringCaseWhenTextsContainValues() { when(mockWebElementConverter.getTextsFrom(mockElements)).thenReturn(asList("B", "Text", "A")); TextsContainCondition condition = new TextsContainCondition(mockWebElementConverter, true, "a", "b", "text"); assertThat(condition.apply(mockElements), equalTo(true)); }
@Test public void shouldNotMatchConditionWhenTextsDoNotContainValues() { when(mockWebElementConverter.getTextsFrom(mockElements)).thenReturn(asList("b", "tsxt", "a")); TextsContainCondition condition = new TextsContainCondition(mockWebElementConverter, false, "a", "b", "text"); assertThat(condition.apply(mockElements), equalTo(false)); }