### Question:
ElementLocatorSearchContext implements SearchContext { @Override public List<WebElement> findElements(By by) { List<WebElement> elements = new ArrayList<>(); List<WebElement> baseElements = locator.findElements(); for (WebElement element : baseElements) { elements.addAll(element.findElements(by)); } return elements; } ElementLocatorSearchContext(ElementLocator locator); @Override List<WebElement> findElements(By by); @Override WebElement findElement(By by);  }### Answer:
@Test public void shouldFindElements() { locatorSearchContext = new ElementLocatorSearchContext(elementLocator); when(elementLocator.findElements()).thenReturn(ImmutableList.of(element1, element2)); when(element1.findElements(by)).thenReturn(ImmutableList.of(webElement1, webElement2)); when(element2.findElements(by)).thenReturn(ImmutableList.of(webElement3, webElement4)); assertThat(locatorSearchContext.findElements(by)).containsExactly(webElement1, webElement2, webElement3, webElement4); }