diff --git a/simple-stack/src/test/java/com/zhuinden/simplestack/BackstackTest.java b/simple-stack/src/test/java/com/zhuinden/simplestack/BackstackTest.java index 147df130..39fe7624 100644 --- a/simple-stack/src/test/java/com/zhuinden/simplestack/BackstackTest.java +++ b/simple-stack/src/test/java/com/zhuinden/simplestack/BackstackTest.java @@ -934,10 +934,12 @@ class InvalidObject { TestObject testObject = new TestObject(); TestObject testPendingObject = new TestObject(); TestObject testRemovedObject = new TestObject(); + Object testNormalObject = new Object(); backstack.addRetainedObject("testObject", testObject); backstack.addRetainedObject("testPendingObject", testPendingObject); backstack.addRetainedObject("testRemovedObject", testRemovedObject); + backstack.addRetainedObject("testNormalObject", testNormalObject); assertThat(testObject.currentState).isEqualTo(3); assertThat(testPendingObject.currentState).isEqualTo(3); @@ -963,6 +965,8 @@ public void handleStateChange(@Nonnull StateChange stateChange, @Nonnull StateCh backstack2.fromBundle(bundle); assertThat(testObject.currentState).isEqualTo(5); + backstack2.addRetainedObject("testNormalObject", testNormalObject); + try { backstack2.addRetainedObject("testPendingObject", new InvalidObject()); Assert.fail();