public boolean hasOnlineDir(int brokerId, Uuid directoryId) {
        BrokerRegistration registration = registration(brokerId);
        return registration != null && registration.hasOnlineDir(directoryId);
    }
@Test
    public void testHasOnlineDir() {
        ClusterControlManager clusterControl = new ClusterControlManager.Builder().
                setClusterId("pjvUwj3ZTEeSVQmUiH3IJw").
                setFeatureControlManager(new FeatureControlManager.Builder().build()).
                setBrokerUncleanShutdownHandler((brokerId, records) -> { }).
                build();
        clusterControl.activate();
        registerNewBrokerWithDirs(clusterControl, 1, asList(Uuid.fromString("dir1SEbpRuG1dcpTRGOvJw"), Uuid.fromString("dir2xaEwR2m3JHTiy7PWwA")));
        assertTrue(clusterControl.registration(1).hasOnlineDir(Uuid.fromString("dir1SEbpRuG1dcpTRGOvJw")));
        assertTrue(clusterControl.hasOnlineDir(1, Uuid.fromString("dir1SEbpRuG1dcpTRGOvJw")));
        assertTrue(clusterControl.hasOnlineDir(1, Uuid.fromString("dir2xaEwR2m3JHTiy7PWwA")));
        assertTrue(clusterControl.hasOnlineDir(1, DirectoryId.UNASSIGNED));
        assertTrue(clusterControl.hasOnlineDir(1, DirectoryId.MIGRATING));
        assertFalse(clusterControl.hasOnlineDir(1, Uuid.fromString("otherAA1QFK4U1GWzkjZ5A")));
        assertFalse(clusterControl.hasOnlineDir(77, Uuid.fromString("8xVRVs6UQHGVonA9SRYseQ")));
        assertFalse(clusterControl.hasOnlineDir(1, DirectoryId.LOST));
    }