:gb: Added opt_type parameter to copyValuesToArray method with tests