@Override
    public boolean registerListener(Object listener) {
        if (listener instanceof HazelcastInstanceAware aware) {
            aware.setHazelcastInstance(node.hazelcastInstance);
        }
        if (listener instanceof ClusterVersionListener clusterVersionListener) {
            clusterVersionListeners.add(clusterVersionListener);
            // on registration, invoke once the listening method so version is properly initialized on the listener
            clusterVersionListener.onClusterVersionChange(getClusterOrNodeVersion());
            return true;
        }
        return false;
    }
@Test
    public void test_clusterVersionListener_invokedOnRegistration() {
        final CountDownLatch latch = new CountDownLatch(1);
        ClusterVersionListener listener = newVersion -> latch.countDown();
        assertTrue(nodeExtension.registerListener(listener));
        assertOpenEventually(latch);
    }