Added tests to complete coverage of the collection api.

I've added some tests to complete coverage of the collection api, as per our email discussion.