The next time a wandering star drifts too close to our solar system and knocks Jupiter loose, the four giant moons circling it will tag along for the ride. Io, Europa, Ganymede, and Callisto will not get left behind. That is the finding from a new study by Yannick Badoux and Simon Portegies Zwart at Leiden Observatory in the Netherlands, who ran nearly 34,000 computer simulations to answer a question astronomers had never properly tested: what happens to moons when their planets get kicked out of their home systems and drift alone through the galaxy?

Scientists have known for years that the Milky Way is full of rogue planets, worlds that formed around stars like our sun but were later flung into interstellar space. Sometimes a neighboring planet gives them a gravitational shove. Sometimes a passing star wanders too close and scatters everything. What nobody knew was whether any moons would survive that violent eviction.

The answer, it turns out, depends on something called the Hill radius. Think of it as an invisible leash around every planet. Inside that leash, the planet's own gravity is strong enough to hold onto a moon. Outside it, the star's pull takes over and the moon drifts away. The researchers found that moons orbiting up to about 40 percent of the way along that leash stay attached during an ejection. Beyond that, the grip fails quickly, and by halfway the moon and planet almost always separate.

Jupiter's moons orbit safely inside that boundary. Io, the volcanic moon, sits at less than 1 percent of Jupiter's Hill radius. Europa, with its hidden ocean beneath a cracked ice shell, is even closer in. If Jupiter were suddenly ripped away tomorrow, all four of its major moons would still be circling it as the whole family tumbled out into the dark between the stars.

This matters more than it might seem. About 90 percent of the time, an ejection barely changes the distance between a planet and its moon at all. That means astronomers could someday look at a rogue world drifting through the galaxy, measure how its moon orbits, and work backward to figure out where it came from and how it got kicked out. The team already tested this idea on a real candidate: a rogue planet detected by gravitational microlensing and cataloged as MOA-2011-BLG-262L, which may carry a small moon. If the detection holds up, the planet likely started out around 5.2 astronomical units from its star, which is almost exactly where Jupiter sits from our sun.

There is one more tantalizing detail. Moons squeezed and stretched by their planet's gravity generate heat from the inside, without needing any sunlight. Europa works this way, keeping its underground ocean from freezing solid. Eject the whole Jovian system into interstellar space and the gravitational squeezing continues. Somewhere out there in the dark, a Jupiter may be drifting with a warm, wet moon still in orbit, carrying its oceans along through the galaxy.