Examples abound - Poland and France both had mutual defense treaties with various allies that failed when Germany invaded. In Japan's backyard, the Philippines lost territory in the South China Sea to China after it decided to cut ties with the U.S. military. As soon as the U.S. pulled away, the Chinese PLA moved right in. An international tribunal in The Hague ruled China's actions were completely illegal, but China has since strengthened its hold by building landing strips and military fortifications on the reefs and small islets.
The Japan/U.S. alliance is strong, but relationships and power profiles can change. Xi's not going anywhere, and he can play the long game when it comes to the Diaoyutai and other territorial claims.
Such thinking was very common going into World War I. The mutual economic interests of all of the nations involved led many people to believe it would be over in a few months.
China has long-range nukes. Behind every treat is political resolve. Would America risk lighting its cities on fire to defend a country across the ocean? (I hope so. But I'm not sure.)
The same could be said of China. Would it risk MAD by invading Japan? The US could be spurred to act due to the threat of eventual isolation and defeat after its allies are picked off. That fear is what fueled the regional wars like Vietnam fought during the Cold War.
In any case, it's estimated that Japan could develop its own indigenous nuclear capability very quickly if the need arose.
https://en.wikipedia.org/wiki/Japanese_nuclear_weapon_progra...
https://www.japantimes.co.jp/news/2016/06/24/national/politi...