@Test public void testRestoresUnmatchedConfig() throws Exception { TestEntity origE = origApp.createAndManageChild( EntitySpec.create(TestEntity.class).configure("myunmatchedkey", "myunmatchedval")); origE.createAndManageChild(EntitySpec.create(TestEntity.class)); newApp = rebind(); final TestEntity newE = (TestEntity) Iterables.find(newApp.getChildren(), Predicates.instanceOf(TestEntity.class)); final TestEntity newChildE = (TestEntity) Iterables.find(newE.getChildren(), Predicates.instanceOf(TestEntity.class)); assertEquals(newE.getAllConfigBag().getStringKey("myunmatchedkey"), "myunmatchedval"); assertEquals(newE.getLocalConfigBag().getStringKey("myunmatchedkey"), "myunmatchedval"); assertEquals(newChildE.getAllConfigBag().getStringKey("myunmatchedkey"), "myunmatchedval"); assertFalse(newChildE.getLocalConfigBag().containsKey("myunmatchedkey")); }