public static void initializeBootstrapProperties(
        Properties properties,
        Optional<String> bootstrapServer,
        Optional<String> bootstrapControllers
    ) {
        if (bootstrapServer.isPresent()) {
            if (bootstrapControllers.isPresent()) {
                throw new InitializeBootstrapException("You cannot specify both " +
                        "--bootstrap-controller and --bootstrap-server.");
            }
            properties.setProperty(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG,
                    bootstrapServer.get());
            properties.remove(AdminClientConfig.BOOTSTRAP_CONTROLLERS_CONFIG);
        } else if (bootstrapControllers.isPresent()) {
            properties.remove(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG);
            properties.setProperty(AdminClientConfig.BOOTSTRAP_CONTROLLERS_CONFIG,
                    bootstrapControllers.get());
        } else {
            throw new InitializeBootstrapException("You must specify either --bootstrap-controller " +
                    "or --bootstrap-server.");
        }
    }
@Test
    public void testInitializeBootstrapPropertiesWithControllerBootstrap() {
        Properties props = createTestProps();
        CommandLineUtils.initializeBootstrapProperties(props,
            Optional.empty(), Optional.of("127.0.0.2:9094"));
        assertNull(props.getProperty("bootstrap.servers"));
        assertEquals("127.0.0.2:9094", props.getProperty("bootstrap.controllers"));
    }