@Test
public void testRemoveInstanceData() throws Exception {

  ViewRegistry registry = ViewRegistry.getInstance();
  ViewInstanceEntity viewInstanceEntity = ViewInstanceEntityTest.getViewInstanceEntity();
  viewInstanceEntity.putInstanceData("foo", "value");
  ViewInstanceDataEntity dataEntity = viewInstanceEntity.getInstanceData("foo");
  viewInstanceDAO.removeData(dataEntity);
  expect(viewInstanceDAO.merge(viewInstanceEntity)).andReturn(viewInstanceEntity);
  replay(viewDAO, viewInstanceDAO, securityHelper);
  registry.removeInstanceData(viewInstanceEntity, "foo");
  Assert.assertNull(viewInstanceEntity.getInstanceData("foo"));
  verify(viewDAO, viewInstanceDAO, securityHelper);
}