unit testing related methods (using closures)