### Question:
FillSelect extends BaseFill<E> { public FillSelect withIndex(int index) { boolean noSuchElement = true; for (E element : getElements()) { Select select = new Select(element.getElement()); try { select.selectByIndex(index); noSuchElement = false; } catch (NoSuchElementException e) { } } if (noSuchElement) { throw new NoSuchElementException("No select element found with option index=" + index); } return this; } FillSelect(FluentList<E> list);  FillSelect(E element); FillSelect withIndex(int index); FillSelect withValue(String value); FillSelect withText(String text);  }### Answer:
@Test public void testFillCss() { FluentList<FluentWebElement> list = fluentAdapter.asFluentList(element1, element2, element3); FillSelect fillConstructor = new FillSelect(list); WebElement option1 = mock(WebElement.class); WebElement option2 = mock(WebElement.class); WebElement option3 = mock(WebElement.class); WebElement option4 = mock(WebElement.class); when(element1.findElements(any(By.class))).thenReturn(singletonList(option1)); when(element2.findElements(any(By.class))).thenReturn(singletonList(option2)); when(element3.findElements(any(By.class))).thenReturn(singletonList(option3)); when(element4.findElements(any(By.class))).thenReturn(singletonList(option4)); when(option1.getAttribute("index")).thenReturn("1"); when(option3.getAttribute("index")).thenReturn("1"); fillConstructor.withIndex(1); verify(option1).click(); verify(option2, never()).click(); verify(option3).click(); verify(option4, never()).click(); Assertions.assertThatThrownBy(() -> fillConstructor.withIndex(5)).isExactlyInstanceOf(NoSuchElementException.class); }