### Question:
Search implements SearchControl<FluentWebElement> { @Override public FluentWebElement el(WebElement rawElement) { return find(singletonList(rawElement)).first(); } Search(SearchContext context, Object container, ComponentInstantiator instantiator,
            FluentInjectControl injectControl); @Override FluentList<FluentWebElement> find(String selector, SearchFilter... filters); @Override FluentList<FluentWebElement> find(SearchFilter... filters); @Override FluentList<FluentWebElement> find(By locator, SearchFilter... filters); @Override FluentList<FluentWebElement> find(List<WebElement> rawElements); @Override FluentWebElement el(WebElement rawElement);  }### Answer:
@Test public void shouldThrowErrorWhenMobileElementNotFound() { assertThatThrownBy(() -> search.el(MobileBy.AndroidUIAutomator("dummy")).click()) .isInstanceOf(NoSuchElementException.class) .hasMessageContaining("By.AndroidUIAutomator") .hasMessageContaining("dummy"); }
@Test public void findFirstShouldReturnFirst() { String name = "cssStyle"; WebElement webElement1 = mock(WebElement.class); when(webElement1.getTagName()).thenReturn("span"); WebElement webElement2 = mock(WebElement.class); List<WebElement> webElements = new ArrayList<>(); webElements.add(webElement1); webElements.add(webElement2); when(searchContext.findElements(By.cssSelector("cssStyle"))).thenReturn(webElements); FluentWebElement fluentWebElement = search.el(name); assertThat(fluentWebElement.tagName()).isEqualTo("span"); }
@Test(expected = NoSuchElementException.class) public void shouldThrowErrorWhenFirstNotFound() { String name = "cssStyle"; FluentWebElement fluentWebElement = search.el(name); assertThat(fluentWebElement.tagName()).isEqualTo("span"); }