         waitForExpectations()
         if collectionID == nil {
             createCollection()
-            addDocumentToCollection()
         }
     }
     

        waitForExpectations()
    }
    
    /** Delete and create a test environment. */
    func testDeleteAndCreateEnvironment() {
        
        let description = "Delete the existing test environment."
        let expectation = self.expectation(description: description)
        
        discovery.deleteEnvironment(withID: self.environmentID!, failure: failWithError) {
            environment in
            
            XCTAssertEqual(environment.environmentID, self.environmentID)
            XCTAssertEqual(environment.status, "deleted")
            
            expectation.fulfill()
        }
        waitForExpectations()
        
        let description2 = "Recreate the deleted environment."
        let expectation2 = self.expectation(description: description2)

        discovery.createEnvironment(
            withName: environmentName,
            withSize: .zero,
            withDescription: testDescription,
            failure: failWithError)
        {
            environment in
            
            // verify that an environment ID was returned, and save this value
            XCTAssertNotNil(environment.environmentID)
            self.environmentID = environment.environmentID
            
            // check all the fields are present
            XCTAssertEqual(environment.name, self.environmentName)
            XCTAssertEqual(environment.description, self.testDescription)
            XCTAssertNotNil(environment.created)
            XCTAssertNotNil(environment.updated)
            XCTAssertNotNil(environment.status)
            XCTAssertNotNil(environment.indexCapacity?.diskUsage)
            XCTAssertNotNil(environment.indexCapacity?.memoryUsage)
            
            // check all the fields within diskUsage are present
            let diskUsage = environment.indexCapacity?.diskUsage
            XCTAssertNotNil(diskUsage?.usedBytes)
            XCTAssertNotNil(diskUsage?.totalBytes)
            XCTAssertNotNil(diskUsage?.used)
            XCTAssertNotNil(diskUsage?.total)
            XCTAssertNotNil(diskUsage?.percentUsed)
            
            // check all the fields within memoryUsage are present
            let memoryUsage = environment.indexCapacity?.memoryUsage
            XCTAssertNotNil(memoryUsage?.usedBytes)
            XCTAssertNotNil(memoryUsage?.totalBytes)
            XCTAssertNotNil(memoryUsage?.used)
            XCTAssertNotNil(memoryUsage?.total)
            XCTAssertNotNil(memoryUsage?.percentUsed)
            
            expectation2.fulfill()
        }
        waitForExpectations()
    }
    
    /** Get the trained environment. */
    func testGetTrainedEnvironment() {

            for collection in collections {
                if collection.name == self.newsCollectionName {
                    self.newsCollectionID = collection.collectionID
                    expectation2.fulfill()
                    return
                }
