The Tokugawa Shoguns never collapsed and the Meiji Restoration never happened. Also Edo Japan lifted the isolation policy for a while inviting foreigners and diplomats into the United Empire of Japan.
The Tokugawa Shogun united Japan and under the new constitution Commodore Matthew Perry became a dignified member of the Tokugawa Parliament. The Qing Dynasty sent Delegates to Tokugawa Japan and established an embassy in the capital of Edo.
The Samurai Act
The new Samurai Act of 1865 enabled the warrior class to continue to defend the Tokugawa Imperial Empire.