     {
         _removeFromStageOnValidateProperties = value;
     }
+
+    public function get numValidateDisplayListCalls():int
+    {
+        return _numValidateDisplayListCalls;
+    }
+
+    public function get numValidateSizeCalls():int
+    {
+        return _numValidateSizeCalls;
+    }
+
+    public function get numValidatePropertiesCalls():int
+    {
+        return _numValidatePropertiesCalls;
+    }
 }
        private static var noEnterFramesRemaining:int = NaN;
        private static const _finishNotifier:EventDispatcher = new EventDispatcher();

        private var _objectWhichIsRemovedOnSizeValidation:SomeComponent;
        private var _creationCompleteCalls:int;

        [Before]
        public function setUp():void
        {
            _creationCompleteCalls = 0;
            _objectWhichIsRemovedOnSizeValidation = new SomeComponent();
            _objectWhichIsRemovedOnSizeValidation.addEventListener(FlexEvent.CREATION_COMPLETE, onCreationComplete);
            UIImpersonator.addElement(_objectWhichIsRemovedOnSizeValidation);
        }

        [After]
        public function tearDown():void
        {
            UIImpersonator.removeAllChildren();
            _objectWhichIsRemovedOnSizeValidation = null;
        }

        [Test]
        public function test_object_removed_from_stage_via_code_is_not_initialized():void
        {
            //given
            UIComponentGlobals.mx_internal::layoutManager.usePhasedInstantiation = false;
            _objectWhichIsRemovedOnSizeValidation.removeFromStageOnValidateProperties = true;

            //when
            _objectWhichIsRemovedOnSizeValidation.validateNow();

            //then
            assertNull("The object was actually not removed from stage. Huh?", _objectWhichIsRemovedOnSizeValidation.parent);
            assertEquals("Yep, this is the bug. Why call initialized=true on an object that's not on stage?", 0, _creationCompleteCalls);
        }

        [Test(async, timeout=500)]
        public function test_object_removed_from_stage_via_user_action_is_not_initialized():void
        {
            //given
            UIComponentGlobals.mx_internal::layoutManager.usePhasedInstantiation = true;
            _objectWhichIsRemovedOnSizeValidation.removeFromStageOnValidateProperties = false;

            //when
            _objectWhichIsRemovedOnSizeValidation.invalidateDisplayList();
            _objectWhichIsRemovedOnSizeValidation.invalidateProperties();
            _objectWhichIsRemovedOnSizeValidation.invalidateSize();

            //then wait 1 frame
            noEnterFramesRemaining = 1;
            UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME, onEnterFrame);
            Async.handleEvent(this, _finishNotifier, Event.COMPLETE, then_remove_from_stage_in_next_frame, 300);
        }

        private function then_remove_from_stage_in_next_frame(event:Event, passThroughData:Object):void
        {
            //when
            _objectWhichIsRemovedOnSizeValidation.pretendUserAskedForComponentRemovalInNextFrame();

            //then wait 2 frames
            noEnterFramesRemaining = 2;
            UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME, onEnterFrame);
            Async.handleEvent(this, _finishNotifier, Event.COMPLETE, then_assert_not_initialized, 300);
        }

        private function then_assert_not_initialized(event:Event, passThroughData:Object):void
        {
            //then
            assertNull("The object was actually not removed from stage. Huh?", _objectWhichIsRemovedOnSizeValidation.parent);
            assertEquals("Yep, this is the bug. Why call initialized=true on an object that's not on stage?", 0, _creationCompleteCalls);
        }


        [Test(async, timeout=750)]
        public function test_object_removed_from_stage_then_readded_is_initialized_once():void
        {
            //given
            UIComponentGlobals.mx_internal::layoutManager.usePhasedInstantiation = true;
            _objectWhichIsRemovedOnSizeValidation.removeFromStageOnValidateProperties = false;

            //when
            _objectWhichIsRemovedOnSizeValidation.validateNow();
            _objectWhichIsRemovedOnSizeValidation.pretendUserAskedForComponentRemovalInNextFrame();

            //then wait 1 frame
            noEnterFramesRemaining = 1;
            UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME, onEnterFrame);
            Async.handleEvent(this, _finishNotifier, Event.COMPLETE, then_readd_object, 200);
        }

        private function then_readd_object(event:Event, passThroughData:Object):void
        {
            //then
            assertNull("The object was actually not removed from stage. Huh?", _objectWhichIsRemovedOnSizeValidation.parent);

            //when
            UIImpersonator.addElement(_objectWhichIsRemovedOnSizeValidation);

            //then wait 4 frames, to make sure validation is done
            noEnterFramesRemaining = 4;

    override public function validateSize(recursive:Boolean = false):void
    {
        super.validateSize(recursive);
        _numValidateSizeCalls++;
    }

    override public function validateDisplayList():void
    {
        super.validateDisplayList();
        _numValidateDisplayListCalls++;
    }

    private function removeFromStage():void
