static String buildAgentArgs(final Map<String, String> configOptions)
    {
        if (configOptions.isEmpty())
        {
            return null;
        }

        final StringBuilder builder = new StringBuilder();
        for (final Map.Entry<String, String> entry : configOptions.entrySet())
        {
            builder.append(entry.getKey())
                .append(VALUE_SEPARATOR)
                .append(entry.getValue())
                .append(OPTION_SEPARATOR);
        }

        if (builder.length() > 0)
        {
            builder.setLength(builder.length() - 1);
        }

        return builder.toString();
    }
@Test
    void shouldCombineConfigOptionsIntoAnAgentArgsString()
    {
        final Map<String, String> configOptions = new LinkedHashMap<>();
        configOptions.put(READER_CLASSNAME, "reader class");
        configOptions.put(DISABLED_CLUSTER_EVENT_CODES, "CANVASS_POSITION");
        configOptions.put(ENABLED_DRIVER_EVENT_CODES, "all");
        configOptions.put(LOG_FILENAME, "file.txt");
        configOptions.put(DISABLED_DRIVER_EVENT_CODES, "admin");

        final String agentArgs = buildAgentArgs(configOptions);

        assertEquals(
            "aeron.event.log.reader.classname=reader class|" +
            "aeron.event.cluster.log.disable=CANVASS_POSITION|" +
            "aeron.event.log=all|" +
            "aeron.event.log.filename=file.txt|" +
            "aeron.event.log.disable=admin",
            agentArgs);
    }