public static void closeAdminClientWithTimeout(AdminClient adminClient, long timeoutMs) {
        closeClientWithTimeout(() -> {
            try {
                ((AutoCloseable) adminClient).close();
            } catch (Exception e) {
                throw new IllegalStateException("Failed to close the Admin Client.", e);
            }
        }, timeoutMs);
    }
Close the given AdminClient with the given timeout.

@param adminClient AdminClient to be closed.
@param timeoutMs   the timeout.
core/src/main/java/kafka/autobalancer/metricsreporter/AutoBalancerMetricsUtils.java