### Question:
ElementInstanceLocator extends ElementSupplierLocator implements WrapsElement { @Override public WebElement getWrappedElement() { return findElement(); } ElementInstanceLocator(WebElement element); @Override WebElement getWrappedElement();  }### Answer:
@Test public void testWithMockElement() { ElementInstanceLocator locator = new ElementInstanceLocator(element); Assertions.assertThat(locator.findElement()).isSameAs(element); Assertions.assertThat(locator.findElements()).containsExactly(element); Assertions.assertThat(locator.getWrappedElement()).isSameAs(element); }
@Test public void testWithNullElement() { ElementInstanceLocator locator = new ElementInstanceLocator(null); Assertions.assertThat(locator.findElement()).isNull(); Assertions.assertThat(locator.findElements()).isEmpty(); Assertions.assertThat(locator.getWrappedElement()).isNull(); }