public function getPpiByDemographicQuestion(Collection $questions, array $applicant_ids, ?string $code): Collection 	{ 		$question = $questions->firstWhere('code', $code); 		$translated_question_answer_count = []; 		$merged_applicant_answers_count = []; 		$applicant_count_by_answer = []; 		$answer_group_sum = 0;  		if (!$question) { 			return collect(); 		}  		$available_answers = empty($question->getTranslation('available_answers', $this->locale)) ? $question->getDefaultTranslation('available_answers') : $question->getTranslation('available_answers', $this->locale);  		foreach ($available_answers as $answer_value => $answer) { 			$applicant_ids = Answer::where([['question_id', $question->id], ['answer_value', $answer_value + 1]])->whereIn('applicant_id', $this->applicants_ids)->pluck('applicant_id')->all();  			$applicants_count = ApplicantCompanyPivot::where('company_id', $this->company->id)->whereIn('applicant_id', $applicant_ids)->count(); 			$applicant_count_by_answer[$answer_value] = $applicants_count; 		}  		if ($question->type === QuestionType::CustomRadio->value && $question->class === QuestionClass::PpiDemographic) { 			foreach ($applicant_count_by_answer as $index => $applicants_answer_count) { 				$question->questionAnswerGroups->each(function (QuestionAnswerGroup $questionAnswerGroups) use (&$merged_applicant_answers_count, $index, &$applicants_answer_count, &$applicant_count_by_answer, &$answer_group_sum) { 					if (in_array($index + 1, $questionAnswerGroups->grouped_values)) { 						$answer_group_sum += $applicants_answer_count;  						$merged_applicant_answers_count[$questionAnswerGroups->getTranslation('title', $this->locale)] = $answer_group_sum; 						unset($applicant_count_by_answer[$index]); 					} 				}); 			} 		}  		if (count($merged_applicant_answers_count) == 0) { 			foreach ($applicant_count_by_answer as $key => $answer) { 				$translated_key = $available_answers[$key];  				$translated_question_answer_count[$translated_key] = $answer; 			} 		} else { 			$translated_question_answer_count = $merged_applicant_answers_count; 		}  		return collect($translated_question_answer_count); 	}