It’s the year 2200. The last inhabitant of Japan dies at age 200, and is buried by robots.
The Chinese do not invade because the robotic defense perimeter is still operational, the factories still work, and the ports are still importing raw materials, and exporting manufactured goods. All of the work is done by robots, including management and banking; and those robots are maintained by other robots.
Visitors are allowed, but there is no work for humans, and the robots charge enormous prices for all human necessities, up to and including excretion.
The Japanese people still exist, overseas, underground on Mars, and floating over Venus.