@Override
    public void onEvent(Event event) {
        if (event instanceof MetadataEvent.InstanceMetadataEvent) {
            handleInstanceMetadataEvent((MetadataEvent.InstanceMetadataEvent) event);
        } else if (event instanceof MetadataEvent.ServiceMetadataEvent) {
            handleServiceMetadataEvent((MetadataEvent.ServiceMetadataEvent) event);
        } else {
            handleClientDisconnectEvent((ClientEvent.ClientDisconnectEvent) event);
        }
    }
@Test
    void testOnEvent() {
        Mockito.when(instanceMetadataEvent.getService()).thenReturn(service);
        Mockito.when(instanceMetadataEvent.getMetadataId()).thenReturn(METADATA_ID);
        Mockito.when(serviceMetadataEvent.getService()).thenReturn(service);
        Mockito.when(clientDisconnectEvent.getClient()).thenReturn(client);
        
        namingMetadataManager.onEvent(instanceMetadataEvent);
        Mockito.verify(instanceMetadataEvent, Mockito.times(2)).getMetadataId();
        Mockito.verify(instanceMetadataEvent, Mockito.times(2)).getService();
        
        namingMetadataManager.onEvent(serviceMetadataEvent);
        Mockito.verify(serviceMetadataEvent).getService();
        
        namingMetadataManager.onEvent(clientDisconnectEvent);
        Mockito.verify(clientDisconnectEvent).getClient();
    }