changed Collection.add to handle duplicated IDs. updated unit test