How to test to see whether a Vaadin object is in use

I have several Java objects pointing to Vaadin components.

Once these Vaadin components are unused however I need an automatic way to detect the removal so that these objects can stop pointing at the Vaadin components (and allow the Vaadin components to be Garbage Collected too)

Is there some way I can test to see whether a Vaadin object is in use or not by the application?

If you want to detect when a component is no longer attached to the UI, you can override the detach() method.

You can also implement
ComponentDetachListener
to detect all detachs from a component container. However, it looks like the listener must be added to the container, it is not sufficient to add it to the application. This may cause some extra work.

I just used isVisible( ) in the end