package com.codeborne.selenide.collections;

import com.codeborne.selenide.impl.Html;
import org.openqa.selenium.WebElement;

import java.util.List;

public class TextsInAnyOrder extends ExactTexts {
  public TextsInAnyOrder(String... expectedTexts) {
    super(expectedTexts);
  }

  public TextsInAnyOrder(List<String> expectedTexts) {
    super(expectedTexts);
  }

  @Override
  public boolean apply(List<WebElement> elements) {
    if (elements.size() != expectedTexts.size()) {
      return false;
    }

    for (int i = 0; i < expectedTexts.size(); i++) {
      String expectedText = expectedTexts.get(i);
      boolean bFound = false;
      for(WebElement element: elements) {
    	  if (Html.text.contains(element.getText(), expectedText)) {
    		  bFound = true;
    	  }
      }
      if(bFound == false) {
    	  return false;
      }
    }
    return true;
  }

  @Override
  public String toString() {
    return "TextsInAnyOrder " + expectedTexts;
  }
}

@@ -646,16 +646,17 @@
      for
+ 
 (WebElem
@@ -684,17 +684,18 @@
 ) %7B%0A    
-%09
+  
   if (Ht
@@ -755,10 +755,12 @@
     
-%09%09
+    
   bF
@@ -776,17 +776,18 @@
 ue;%0A    
-%09
+  
   %7D%0A    
@@ -798,16 +798,17 @@
       if
+ 
 (bFound 
@@ -827,9 +827,10 @@
     
-%09
+  
   re

fix checkstyle