public function merge(string $returnTypeClass, $existingInstance, $newInstance)
    {
        if ($existingInstance === null) {
            return $newInstance;
        }
        if (array_key_exists($returnTypeClass, $this->getRequiredFields()) && $newInstance !== null) {
            foreach ($this->getRequiredFields()[$returnTypeClass] as $property) {
                if (is_array($existingInstance)) {
                    $existingInstanceSize = sizeof($existingInstance);
                    for ($index = 0; $index < $existingInstanceSize; $index++) {
                        if ($existingInstance[$index]->{$property} === null) {
                            $existingInstance[$index]->{$property} = $newInstance[$index]->{$property};
                        }
                    }
                } elseif ($existingInstance->{$property} === null) {
                    $existingInstance->{$property} = $newInstance->{$property};
                }
            }
        }
        return $existingInstance;
    }