public void testSetHousedViewManifestation(boolean stale, boolean dirty, final boolean save, boolean expectPrompt, boolean expectChange, boolean expectSave) {
// Select something in the inspector
inspectorPropertyChangeListener.propertyChange(mockPropertyEvent);
// Create a new view to switch to
ViewInfo newViewInfo = Mockito.mock(ViewInfo.class);
@SuppressWarnings("serial")
View newView = new View(mockComponent, newViewInfo) {};
Mockito.when(mockComponent.isStale()).thenReturn(stale);
Mockito.when(mockComponent.isDirty()).thenReturn(dirty);
Mockito.when(newViewInfo.createView(mockComponent)).thenReturn(newView);
Mockito.when(newViewInfo.getType()).thenReturn("new");
Mockito.when(mockWindowManager.showInputDialog(Mockito.anyString(), Mockito.anyString(), Mockito.<Object[]>any(), Mockito.any(), Mockito.<Map<String,Object>>any())).thenAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Object[] options = (Object[]) invocation.getArguments()[2];
return save ? options[0] : options[1]; // options[0] presumed to mean "OK"