Adds clear() method to object pool.