private static HttpUrl generateSolrURL(
        String hostname,
        int port,
        List<String> pathSegments,
        Map<String, String> parameters
    ) throws URISyntaxException {
        HttpUrl.Builder builder = new HttpUrl.Builder();
        builder.scheme("http");
        builder.host(hostname);
        builder.port(port);
        // Path
        builder.addPathSegment("solr");
        if (pathSegments != null) {
            pathSegments.forEach(builder::addPathSegment);
        }
        // Query Parameters
        parameters.forEach(builder::addQueryParameter);
        return builder.build();
    }
Creates a new collection

@param hostname          the Hostname under which solr is reachable
@param port              The Port on which solr is running
@param collectionName    the name of the collection which should be created
@param configurationName the name of the configuration which should used to create the collection
                         or null if the default configuration should be used
modules/solr/src/main/java/org/testcontainers/containers/SolrClientUtils.java