adding toArray method
adding tests for collection (and a stub to use)