### Question:
MouseElementActions { public MouseElementActions dragAndDropByWithTargetOffset(WebElement target, int xOffset, int yOffset) { loadElementAndPerform(actions().clickAndHold(element).moveToElement(target, xOffset, yOffset).release()); 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 dragAndDropByWithTargetOffset() { MouseElementActions actions = new MouseElementActions(driver, element); LocatableElement target = mock(LocatableElement.class); Coordinates targetCoordinates = mock(Coordinates.class); when(target.getCoordinates()).thenReturn(targetCoordinates); actions.dragAndDropByWithTargetOffset(target, 10, 20); verify(mouse).mouseDown(coordinates); verify(mouse).mouseMove(targetCoordinates, 10, 20); verify(mouse).mouseUp(null); }