void () { final MyElement oldElement = createElement(""); final MyElement[] element = new MyElement[]{oldElement}; final MyElement stable = getDomManager().createStableValue(() -> element[0]); element[0] = null; //noinspection CastToIncompatibleInterface ((StableElement<?>) stable).invalidate(); assertEquals(stable, stable); assertEquals(oldElement.toString(), stable.toString()); }