public synchronized boolean createCollection(String collectionName)
      throws MongoDBResourceManagerException {
    LOG.info("Creating collection using collectionName '{}'.", collectionName);

    try {
      // Check to see if the Collection exists
      if (collectionExists(collectionName)) {
        return false;
      }
      // The Collection does not exist in the database, create it and return true.
      getDatabase().createCollection(collectionName);
    } catch (Exception e) {
      throw new MongoDBResourceManagerException("Error creating collection.", e);
    }

    LOG.info("Successfully created collection {}.{}", databaseName, collectionName);

    return true;
  }
@Test
  public void testCreateCollectionShouldThrowErrorWhenCollectionNameIsInvalid() {
    assertThrows(
        MongoDBResourceManagerException.class, () -> testManager.createCollection("invalid$name"));
  }