public function getQuestionDataForPpiApplicants(?Question $question, Collection $applicants): Collection 	{ 		if (!$question) { 			return collect(); 		}  		$applicantIds = $applicants->pluck('applicant_id');  		$answers = $question->answers->whereIn('applicant_id', $applicantIds);  		$answer_array = [];  		$answers->each(function (Answer $answer) use (&$answer_array) { 			$answer_value = $answer->answer_value;  			if (is_array($answer_value)) { 				$answer_array = array_merge($answer_array, $answer_value); 			} elseif (is_numeric($answer_value)) { 				$answer_array[] = $answer_value; 			} 		});  		$available_answers = empty($question->getTranslation('available_answers', $this->locale)) ? $question->getDefaultTranslation('available_answers') : $question->getTranslation('available_answers', $this->locale);  		$merged = [];  		if ($question->type === QuestionType::CustomRadio->value && $question->class === QuestionClass::PpiDemographic) { 			$question->questionAnswerGroups->each(function (QuestionAnswerGroup $questionAnswerGroups) use (&$merged, &$answer_array) { 				foreach ($answer_array as $index => $answer) { 					if (in_array($answer, $questionAnswerGroups->grouped_values)) { 						$merged[$questionAnswerGroups->getTranslation('title', $this->locale)] = isset($merged[$questionAnswerGroups->getTranslation('title', $this->locale)]) ? ++$merged[$questionAnswerGroups->getTranslation('title', $this->locale)] : 1; 						unset($answer_array[$index]); 					} 				} 			}); 		}  		$counted_answers_array = array_count_values($answer_array);  		$counted_answers_array = collect($counted_answers_array);  		$translated_counted_array = [];  		$counted_answers_array->map(function (int $value, int $key) use ($available_answers, &$translated_counted_array) { 			$translated_key = $available_answers[$key - 1] ?? ($key);  			$translated_counted_array[$translated_key] = $value; 		});  		$merged = array_merge($merged, $translated_counted_array);  		arsort($merged);  		$merged = collect($merged);  		return collect( 			[  				'title' => $question->getTranslation('title', $this->locale), 				'data' => $merged, 			] 		); 	}