### Question:
ElementListInstanceLocator extends ElementListSupplierLocator implements WrapsElements { @Override public List<WebElement> getWrappedElements() { return findElements(); } ElementListInstanceLocator(List<WebElement> elements); @Override List<WebElement> getWrappedElements();  }### Answer:
@Test public void testWithMockElements() { ElementListInstanceLocator locator = new ElementListInstanceLocator( Arrays.asList(element1, element2, element3, element4)); Assertions.assertThat(locator.findElement()).isSameAs(element1); Assertions.assertThat(locator.findElements()).containsExactly(element1, element2, element3, element4); Assertions.assertThat(locator.getWrappedElements()).containsExactly(element1, element2, element3, element4); }
@Test public void testWithNoElement() { ElementListInstanceLocator locator = new ElementListInstanceLocator(Collections.emptyList()); Assertions.assertThat(locator.findElement()).isNull(); Assertions.assertThat(locator.findElements()).isEmpty(); Assertions.assertThat(locator.getWrappedElements()).isEmpty(); }