### Question:
DelegatingGridWidgetDndMouseMoveHandler extends GridWidgetDnDMouseMoveHandler { @Override protected void findMovableRows(final GridWidget view, final BaseGridRendererHelper.RenderingInformation renderingInformation, final double cx, final double cy) { super.findMovableRows(view, renderingInformation, cx, cy); if (view instanceof HasRowDragRestrictions) { final HasRowDragRestrictions hasRowDragRestrictions = (HasRowDragRestrictions) view; if (!hasRowDragRestrictions.isRowDragPermitted(state)) { state.reset(); layer.getViewport().getElement().getStyle().setCursor(state.getCursor()); } } } DelegatingGridWidgetDndMouseMoveHandler(final GridLayer layer,
                                                   final GridWidgetDnDHandlersState state);   }### Answer:
@Test public void testDelegationToGridWidget() { final GridWidget view = mock(GridWidget.class); doReturn(rendererHelper).when(view).getRendererHelper(); handler.findMovableRows(view, rendererHelper.getRenderingInformation(), 0, 0); verify(state, never()).reset(); }
@Test public void testDelegationToHasRowDragRestrictionsWhenPermitted() { final ContextGrid view = mock(ContextGrid.class); doReturn(rendererHelper).when(view).getRendererHelper(); doReturn(true).when(view).isRowDragPermitted(eq(state)); handler.findMovableRows(view, rendererHelper.getRenderingInformation(), 0, 0); verify(state, never()).reset(); }
@Test public void testDelegationToHasRowDragRestrictionsWhenNotPermitted() { final ContextGrid view = mock(ContextGrid.class); doReturn(rendererHelper).when(view).getRendererHelper(); doReturn(false).when(view).isRowDragPermitted(eq(state)); doReturn(Style.Cursor.DEFAULT).when(state).getCursor(); doReturn(viewport).when(gridLayer).getViewport(); doReturn(element).when(viewport).getElement(); doReturn(style).when(element).getStyle(); handler.findMovableRows(view, rendererHelper.getRenderingInformation(), 0, 0); verify(state).reset(); verify(style).setCursor(eq(Style.Cursor.DEFAULT)); }