protected void runJmxFeedIsPersisted(boolean preCreateJmxHelper) throws Exception {
TestEntity origEntity = origApp.createAndManageChild(EntitySpec.create(TestEntity.class).impl(MyEntityWithJmxFeedImpl.class)
.configure(MyEntityWithJmxFeedImpl.PRE_CREATE_JMX_HELPER, preCreateJmxHelper));
origApp.start(ImmutableList.<Location>of());
jmxService = new JmxService(origEntity);
GeneralisedDynamicMBean mbean = jmxService.registerMBean(MutableMap.of(JMX_ATTRIBUTE_NAME, "myval"), OBJECT_NAME);
EntityAsserts.assertAttributeEqualsEventually(origEntity, SENSOR_STRING, "myval");
assertEquals(origEntity.feeds().getFeeds().size(), 1);
newApp = rebind();
TestEntity newEntity = (TestEntity) Iterables.getOnlyElement(newApp.getChildren());
Collection<Feed> newFeeds = newEntity.feeds().getFeeds();
assertEquals(newFeeds.size(), 1);
newEntity.sensors().set(SENSOR_STRING, null);
EntityAsserts.assertAttributeEqualsEventually(newEntity, SENSOR_STRING, "myval");
}