public void createTopic(final String topic,
                            final int partitions,
                            final int replication,
                            final Map<String, String> topicConfig) {
        log.debug("Creating topic { name: {}, partitions: {}, replication: {}, config: {} }",
            topic, partitions, replication, topicConfig);
        final NewTopic newTopic = new NewTopic(topic, partitions, (short) replication);
        newTopic.configs(topicConfig);

        try (final Admin adminClient = createAdminClient()) {
            adminClient.createTopics(Collections.singletonList(newTopic)).all().get();
        } catch (final InterruptedException | ExecutionException e) {
            throw new RuntimeException(e);
        }
    }
Create a Kafka topic with the given parameters.

@param topic       The name of the topic.
@param partitions  The number of partitions for this topic.
@param replication The replication factor for (partitions of) this topic.
@param topicConfig Additional topic-level configuration settings.
streams/src/test/java/org/apache/kafka/streams/integration/utils/KafkaEmbedded.java