code: @Override
    public <T> void createCollection(String collectionName) {
      CollectionMetaData cmd = cmdMap.get(collectionName);
      if (null == cmd) {
        throw new InvalidJsonDbApiUsageException(
            "No class found with @Document Annotation and attribute collectionName as: " + collectionName);
      }
      @SuppressWarnings("unchecked")
      Map<Object, T> collection = (Map<Object, T>) collectionsRef.get().get(collectionName);
      if (null != collection) {
        throw new InvalidJsonDbApiUsageException("Collection by name '" + collectionName + "' already exists.");
      }
  
      cmd.getCollectionLock().writeLock().lock();
  
      // Some other thread might have created same collection when this thread reached this point
      if(collectionsRef.get().get(collectionName) != null) {
        return;
      }
  
      try {
        String collectionFileName = collectionName + ".json";
        File fileObject = new File(dbConfig.getDbFilesLocation(), collectionFileName);
        try {
          fileObject.createNewFile();
        } catch (IOException e) {
          logger.error("IO Exception creating the collection file {}", collectionFileName, e);
          throw new InvalidJsonDbApiUsageException("Unable to create a collection file for collection: " + collectionName);
        }
  
        if (Util.stampVersion(dbConfig, fileObject, cmd.getSchemaVersion())) {
          collection = new LinkedHashMap<Object, T>();
          collectionsRef.get().put(collectionName, collection);
          contextsRef.get().put(collectionName, JXPathContext.newContext(collection.values())) ;
          fileObjectsRef.get().put(collectionName, fileObject);
          cmd.setActualSchemaVersion(cmd.getSchemaVersion());
        } else {
          fileObject.delete();
          throw new JsonDBException("Failed to stamp version for collection: " + collectionName);
        }
      } finally {
        cmd.getCollectionLock().writeLock().unlock();
      }
    }
docs: /* (non-Javadoc)
  @see io.jsondb.JsonDBOperations#createCollection(java.lang.String)