database.commit();
String originalName = account.getName();
database.begin(TXTYPE.OPTIMISTIC);
Assert.assertEquals(account.getAddresses().size(), 2);
account.getAddresses().remove(1); // delete one of the objects in the Books collection to see how rollback behaves
Assert.assertEquals(account.getAddresses().size(), 1);
account.setName("New Name"); // change an attribute to see if the change is rolled back