public void testWarningDialog(ContextAwareAction action, AbstractComponent comp, boolean confirm, boolean prompt, final Set<AbstractComponent> expect) {
// Elaborate mocking to simulate context menu activation
MCTHousing mockHousing = Mockito.mock(MCTHousing.class);
MCTContentArea mockContentArea = Mockito.mock(MCTContentArea.class);
View mockView = Mockito.mock(View.class);
ActionContextImpl mockContext = Mockito.mock(ActionContextImpl.class);
Mockito.when(mockContext.getInspectorComponent()).thenReturn(comp);
Mockito.when(mockContext.getTargetComponent()).thenReturn(comp);
Mockito.when(mockContext.getTargetHousing()).thenReturn(mockHousing);
Mockito.when(mockHousing.getContentArea()).thenReturn(mockContentArea);
Mockito.when(mockContentArea.getHousedViewManifestation()).thenReturn(mockView);
Mockito.when(mockView.getManifestedComponent()).thenReturn(comp);
// Generate a new persistence provider each time