package com.codeborne.selenide.collections;

import org.junit.Test;
import org.openqa.selenium.WebElement;

import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class TextsInAnyOrderTest {

  @Test
  public void testApplyWithSameOrder() {
    TextsInAnyOrder texts = new TextsInAnyOrder(asList("One", "Two", "Three"));
    testApplyMethod(true, texts);
  }
  
  @Test
  public void testApplyWithDifferentOrder() {
    TextsInAnyOrder texts = new TextsInAnyOrder(asList("Two", "One", "Three"));
    testApplyMethod(true, texts);
  }
  
  @Test
  public void testApplyWithWrongListSize() {
    TextsInAnyOrder texts = new TextsInAnyOrder(asList("Two", "One"));
    testApplyMethod(false, texts);
  }
  
   @Test
  public void testApplyWithBiggerSize() {
    TextsInAnyOrder texts = new TextsInAnyOrder(asList("Two", "One", "four", "three"));
    testApplyMethod(false, texts);
  }



  private void testApplyMethod(boolean shouldMatch, TextsInAnyOrder texts) {
   WebElement mockElement1 = mock(WebElement.class);
    WebElement mockElement2 = mock(WebElement.class);
    WebElement mockElement3 = mock(WebElement.class);

    when(mockElement1.getText()).thenReturn("One");
    when(mockElement2.getText()).thenReturn("Two");
    when(mockElement3.getText()).thenReturn("Three");
    assertEquals(shouldMatch, texts.apply(asList(mockElement1, mockElement2, mockElement3)));
  
	  
  }
  
  @Test
  public void testToString() {
    assertEquals("TextsInAnyOrder [One, Two]", new TextsInAnyOrder(asList("One", "Two")).toString());
  }

}

@@ -158,222 +158,37 @@
 tic 
-java.util.Collections.emptyList;%0Aimport static java.util.Collections.singletonList;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue
+org.junit.Assert.assertEquals
 ;%0Aim
@@ -817,17 +817,16 @@
 %0A  %0A
- 
   @Test%0A
   pu
@@ -813,32 +813,32 @@
 %0A  %7D%0A  %0A  @Test%0A
+
   public void te
@@ -1070,16 +1070,17 @@
 exts) %7B%0A
+ 
    WebEl
@@ -1116,32 +1116,32 @@
 Element.class);%0A
-
     WebElement m
@@ -1387,24 +1387,24 @@
 n(%22Three%22);%0A
+
     assertEq
@@ -1489,15 +1489,8 @@
 ));%0A
-  %0A%09  %0A
   %7D%0A

fix checkstyle