Merge headers in a static function; Add unit test.