{
final String BEAN_NAME = "persistentBackingBean";
PersistentBackingBean bean = (PersistentBackingBean) applicationContext.getBean(BEAN_NAME);
UserData user = bean.createUser();
bean.invalidateAndRestartConversation();
/* here we access the new conversation */
UserData restartedUser = bean.getRestartedUser();
assertNotNull("should have got a user", restartedUser);
assertNotSame("should not be the same user", user, restartedUser);
assertEquals("has to be the same user id", user.getId(), restartedUser.getId());
/* end all conversations*/
ConversationManager.getInstance().clearCurrentConversationContext();
bean.updateUser(user.getId(), "test2");
/* invalidate conversation */
bean.invalidateConversation();
UserData user4 = bean.readUser(user.getId());
assertNotNull(user4);
assertEquals(user.getId(), user4.getId());
assertEquals("test", user4.getUsername());
}