String from(Workload workload) {
        if (workload.name != null) {
            return workload.name;
        }
        Map<String, Object> params = new HashMap<>();
        params.put("topics", countToDisplaySize(workload.topics));
        params.put("partitionsPerTopic", countToDisplaySize(workload.partitionsPerTopic));
        params.put("messageSize", countToDisplaySize(workload.messageSize));
        params.put("subscriptionsPerTopic", countToDisplaySize(workload.subscriptionsPerTopic));
        params.put("producersPerTopic", countToDisplaySize(workload.producersPerTopic));
        params.put("consumerPerSubscription", countToDisplaySize(workload.consumerPerSubscription));
        params.put(
                "producerRate",
                (workload.producerRate >= MAX_PRODUCER_RATE)
                        ? "max-rate"
                        : countToDisplaySize(workload.producerRate));
        params.put("keyDistributor", workload.keyDistributor);
        params.put("payloadFile", workload.payloadFile);
        params.put("useRandomizedPayloads", workload.useRandomizedPayloads);
        params.put("randomBytesRatio", workload.randomBytesRatio);
        params.put("randomizedPayloadPoolSize", countToDisplaySize(workload.randomizedPayloadPoolSize));
        params.put("consumerBacklogSizeGB", countToDisplaySize(workload.consumerBacklogSizeGB));
        params.put("testDurationMinutes", workload.testDurationMinutes);
        params.put("warmupDurationMinutes", workload.warmupDurationMinutes);
        return StrSubstitutor.replace(format, params, "${", "}");
    }
@Test
    void nameOverride() {
        Workload workload = new Workload();
        workload.name = "x";
        String name = new WorkloadNameFormat(nameFormat).from(workload);
        assertThat(name).isEqualTo("x");
    }