### Question:
RelationshipEditionDialog implements PropertyEditionPopup { void onCascadeAllChanged() { if (view.getCascadeAll()) { enableCascadeTypes(true, false); view.setCascadePersist(true); view.setCascadeMerge(true); view.setCascadeRemove(true); view.setCascadeRefresh(true); view.setCascadeDetach(true); } else { enableCascadeTypes(true, true); if (cascadeAllWasClicked) { view.setCascadePersist(false); view.setCascadeMerge(false); view.setCascadeRemove(false); view.setCascadeRefresh(false); view.setCascadeDetach(false); } } cascadeAllWasClicked = true; } @Inject  RelationshipEditionDialog(View view); @Override Widget asWidget(); @Override @SuppressWarnings("unchecked") void show(); @Override void setOkCommand(Command okCommand); @Override void setProperty(PropertyEditorFieldInfo property); @Override String getStringValue(); @Override void setStringValue(String value);  }### Answer:
@Test public void testOnCascadeAllChangedTrue() { when(view.getCascadeAll()).thenReturn(true); dialog.onCascadeAllChanged(); verifyCascadeTypesEnabled(1, true, false, false, false, false, false); verifyCascadeTypesValues(true, true, true, true, true); }
@Test public void testOnCascadeAllChangedFalse() { when(view.getCascadeAll()).thenReturn(false); dialog.onCascadeAllChanged(); verifyCascadeTypesEnabled(1, true, true, true, true, true, true); verify(view, never()).setCascadePersist(anyBoolean()); verify(view, never()).setCascadeMerge(anyBoolean()); verify(view, never()).setCascadeRemove(anyBoolean()); verify(view, never()).setCascadeRefresh(anyBoolean()); verify(view, never()).setCascadeDetach(anyBoolean()); }
@Test public void testOnCascadeAllChangedFalse2() { when(view.getCascadeAll()).thenReturn(false); dialog.onCascadeAllChanged(); dialog.onCascadeAllChanged(); verifyCascadeTypesEnabled(2, true, true, true, true, true, true); verifyCascadeTypesValues(false, false, false, false, false); }