The stuff with the Chinese general was entirely made up for the movie. It wasn’t in the script (the version I read, anyway), and, yes, it felt awfully Inception-y. I liked the movie, but I found the ending morally reprehensible, both in the script and the final version.