code: public void createCollection(String collectionName, String configSet) throws SolrException {
          logger.debug("Creating collection: host={}, collection={}, config={}, numShards={}, numReplicas={}",
                  host, collectionName, configSet, 1, 1);
          try {
              CollectionAdminRequest request = CollectionAdminRequest.createCollection(collectionName, configSet, 1, 1);
              request.process(solrClient);
          } catch (Exception e) {
              throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
          }
      }
docs: Create a Solr collection from a configuration directory. The configuration has to be uploaded to the zookeeper,
  $ ./bin/solr zk upconfig -n <config name> -d <path to the config dir> -z <host:port zookeeper>.
  For Solr, collection name, configuration name and number of shards are mandatory in order to create a collection.
  Number of replicas is optional.
  
  @param collectionName Collection name
  @param configSet      Configuration name
  @throws SolrException Exception