Exception handling added to testCollection method.