@@ -0,0 +1,3175 @@
+package com.codeborne.selenide.impl;%0A%0Aimport com.codeborne.selenide.SelenideElement;%0Aimport org.junit.Test;%0Aimport org.mockito.Mockito;%0Aimport org.openqa.selenium.WebElement;%0A%0Aimport java.lang.reflect.Field;%0Aimport java.util.Collections;%0A%0Aimport static org.junit.Assert.*;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class SelenideElementIteratorTest %7B%0A%0A  @Test%0A  public void testConstructor() throws NoSuchFieldException, IllegalAccessException %7B%0A    WebElementsCollection mockedWebElementCollection = Mockito.mock(WebElementsCollection.class);%0A    SelenideElementIterator selenideElementIterator = new SelenideElementIterator(mockedWebElementCollection);%0A%0A    Field indexField = selenideElementIterator.getClass().getDeclaredField(%22index%22);%0A    indexField.setAccessible(true);%0A    Field collectionField = selenideElementIterator.getClass().getDeclaredField(%22collection%22);%0A    collectionField.setAccessible(true);%0A%0A    assertEquals(0, indexField.get(selenideElementIterator));%0A    assertEquals(mockedWebElementCollection, collectionField.get(selenideElementIterator));%0A  %7D%0A%0A  @Test%0A  public void testHasNext() %7B%0A    WebElementsCollection mockedWebElementCollection = Mockito.mock(WebElementsCollection.class);%0A    when(mockedWebElementCollection.getActualElements()).thenReturn(Collections.singletonList(Mockito.mock(WebElement.class)));%0A    SelenideElementIterator selenideElementIterator = new SelenideElementIterator(mockedWebElementCollection);%0A    assertTrue(selenideElementIterator.hasNext());%0A  %7D%0A%0A  @Test%0A  public void testDoesNotHasNext() %7B%0A    WebElementsCollection mockedWebElementCollection = Mockito.mock(WebElementsCollection.class);%0A    when(mockedWebElementCollection.getActualElements()).thenReturn(Collections.emptyList());%0A    SelenideElementIterator selenideElementIterator = new SelenideElementIterator(mockedWebElementCollection);%0A    assertFalse(selenideElementIterator.hasNext());%0A  %7D%0A%0A  @Test%0A  public void testNext() %7B%0A    WebElementsCollection mockedWebElementCollection = Mockito.mock(WebElementsCollection.class);%0A    WebElement mockedWebElement = Mockito.mock(WebElement.class);%0A    when(mockedWebElement.isDisplayed()).thenReturn(true);%0A    when(mockedWebElement.getTagName()).thenReturn(%22a%22);%0A    when(mockedWebElement.getText()).thenReturn(%22selenide%22);%0A%0A    when(mockedWebElementCollection.getActualElements()).thenReturn(Collections.singletonList(mockedWebElement));%0A    SelenideElementIterator selenideElementIterator = new SelenideElementIterator(mockedWebElementCollection);%0A    SelenideElement nextElement = selenideElementIterator.next();%0A%0A    assertTrue(nextElement != null);%0A    assertEquals(%22%3Ca%3Eselenide%3C/a%3E%22, nextElement.toString());%0A    assertFalse(selenideElementIterator.hasNext());%0A  %7D%0A%0A  @Test%0A  public void testRemove() %7B%0A    try %7B%0A      WebElementsCollection mockedWebElementCollection = Mockito.mock(WebElementsCollection.class);%0A      SelenideElementIterator selenideElementIterator = new SelenideElementIterator(mockedWebElementCollection);%0A      selenideElementIterator.remove();%0A    %7D catch (UnsupportedOperationException e) %7B%0A      assertEquals(%22Cannot remove elements from web page%22, e.getMessage());%0A    %7D%0A  %7D%0A%7D%0A

add SelenideElementIterator unit tests