Added unit tests for collection/batch functionality.