person.address = null;
AddressEditor addressEditor = new AddressEditor();
PersonEditorWithOptionalAddressEditor editor =
new PersonEditorWithOptionalAddressEditor(addressEditor);
PersonEditorWithOptionalAddressDriver driver =
GWT.create(PersonEditorWithOptionalAddressDriver.class);
driver.initialize(editor);
driver.edit(person);
// Freshly-initialized should not be dirty
assertFalse(driver.isDirty());
// Change the instance being edited
Address a = new Address();
editor.address.setValue(a);
assertTrue(driver.isDirty());
// Check restoration works
editor.address.setValue(null);
assertFalse(driver.isDirty());
}