### Question:
MouseElementActions { public MouseElementActions moveToElement() { loadElementAndPerform(actions().moveToElement(element)); return this; } MouseElementActions(WebDriver driver, WebElement element);  MouseElementActions(WebDriver driver, FluentWebElement fluentWebElement); @Deprecated Mouse basic(); MouseElementActions clickAndHold(); MouseElementActions release(); MouseElementActions click(); MouseElementActions doubleClick(); MouseElementActions moveToElement(); MouseElementActions moveToElement(WebElement target); MouseElementActions moveToElement(int xOffset, int yOffset); MouseElementActions moveToElement(WebElement target, int xOffset, int yOffset); MouseElementActions contextClick(); MouseElementActions dragAndDropFrom(WebElement source); MouseElementActions dragAndDropTo(WebElement target); MouseElementActions dragAndDropBy(int xOffset, int yOffset); MouseElementActions dragAndDropByWithTargetOffset(WebElement target, int xOffset, int yOffset);  }### Answer:
@Test public void moveToElement() { MouseElementActions actions = new MouseElementActions(driver, element); actions.moveToElement(); verify(mouse).mouseMove(coordinates); }
@Test public void moveToTargetElement() { LocatableElement target = mock(LocatableElement.class); Coordinates targetCoordinates = mock(Coordinates.class); when(target.getCoordinates()).thenReturn(targetCoordinates); MouseElementActions actions = new MouseElementActions(driver, element); actions.moveToElement(target); verify(mouse).mouseMove(targetCoordinates); }
@Test public void moveToElementOffset() { MouseElementActions actions = new MouseElementActions(driver, element); actions.moveToElement(10, 20); verify(mouse).mouseMove(coordinates, 10, 20); }
@Test public void moveToTargetElementOffset() { LocatableElement target = mock(LocatableElement.class); Coordinates targetCoordinates = mock(Coordinates.class); when(target.getCoordinates()).thenReturn(targetCoordinates); MouseElementActions actions = new MouseElementActions(driver, element); actions.moveToElement(target, 10, 20); verify(mouse).mouseMove(targetCoordinates, 10, 20); }