@Test
public void testRemoveDecisionTableWhenPinned() {

    final Command callback = mock(Command.class);
    final GridPinnedModeManager.PinnedContext context = mock(GridPinnedModeManager.PinnedContext.class);
    when(defaultGridLayer.isGridPinned()).thenReturn(true);
    when(defaultGridLayer.getPinnedContext()).thenReturn(context);
    when(context.getGridWidget()).thenReturn(dtableView);
    view.removeDecisionTable(dtableView,
                             callback);
    verify(defaultGridLayer,
           times(1)).exitPinnedMode(commandArgumentCaptor.capture());
    final Command command = commandArgumentCaptor.getValue();
    assertNotNull(command);
    command.execute();
    verify(defaultGridLayer,
           times(1)).remove(dtableView);
    verify(callback,
           times(1)).execute();
    verify(defaultGridLayer,
           times(1)).batch();
}