When two passengers on a Celebrity Cruises ship tested positive for the coronavirus during the company’s first Caribbean cruise this month, it was an unwelcome development. But not entirely unexpected.

The CEO of Celebrity’s parent company, Royal Caribbean Group, had predicted months earlier that the virus could sneak on board, despite precautions to keep it off.

“We’ve been very explicit about this: You can’t eliminate covid-19 in society, and you can’t totally eliminate it on a cruise ship,” said chief executive Richard Fain, speaking during the Phocuswright Conference in November. “The objective is not to say there can’t ever be a case on board. But if there’s a case, it is isolated out and it remains a case rather than an outbreak.”

As cruise ships slowly start to return to service in the United States — months after restarting in limited fashion in places including Europe and Asia — all eyes will be on the seas to see whether the embattled industry can avoid the kind of early outbreaks that laid it up for more than a year.

Their return is buoyed by expert advice, cruise-specific health guidelines that took months to develop, plenty of new research on how the virus spreads, advances in rapid testing and — most importantly — the availability of highly effective vaccines.

Most of that was not available to cruise lines in the earliest days of the pandemic, when the virus tore through ships and passengers and crew fell ill as they were forced to remain on board. Operators scrambled to arrange plans to get sick passengers to facilities on land — though some who were sick died before they could leave the ship.

More than a year later, recent examples have shown the virus isn’t done with cruise ships yet. Just days before the Celebrity case in the Caribbean, two passengers on an MSC Cruises ship in the Mediterranean tested positive during routine mid-trip screening.

And earlier this month, one of the first voyages scheduled from the United States was postponed for nearly a month after eight crew members tested positive. They had received the one-dose Johnson & Johnson vaccine, but not enough time had passed for them to be fully vaccinated when they tested positive.

“You can never entirely eliminate covid from any community, even a fully vaccinated one, but you can keep people safe,” said Vin Gupta, a pulmonary/critical-care physician who teaches health metrics sciences at the University of Washington’s Institute for Health Metrics and Evaluation. He said that if passengers were not vaccinated, he would recommend mandatory rapid PCR tests every 48 hours and masking.

The industry is still focused on keeping sick passengers on the ground through testing requirements, health screenings and vaccine mandates or recommendations. But operators have also introduced a number of measures to keep the virus from spreading if someone is found to be infected.

While exact protocols vary depending on the cruise line, they are using a variety of measures to avoid outbreaks, according to Cruise Lines International Association spokeswoman Bari Golin-Blaugrund.

Those include testing passengers and crew on the ship and isolating positive cases quickly in dedicated staterooms, as well is identifying, screening and quarantining anyone who was a close contact of infected passengers or crew.

Ships have updated their medical facilities and staffing to better be able to handle covid-19 cases if they emerge. And operators have prearranged agreements with destinations to bring patients to land and provide them with care, a place to stay and transportation.

Positive cases have to be reported immediately to authorities. And ships have disinfection procedures in place after someone tests positive.

Ships are also sailing at reduced capacity to allow for social distancing on board, and masks are required in many cases, depending on the vaccination status of passengers.

“These procedures are designed to both care for affected passengers as well as limit spread amongst others onboard, and they have been proven effective when executed according to plan,” Golin-Blaugrund said in an email.

She said that more than 550,000 passengers have sailed on ocean cruises operated by member lines since last summer, with “a lower incidence rate than on land.” The organization could not provide the number of cases that have been reported since ships started sailing again.

In the recent cases involving ships with passengers, the cruise lines said testing did not reveal any additional positive cases.

On the MSC Seaside, the passengers, their travel groups and close contacts were isolated immediately and got off the ship at its next stop to be brought home “by protected MSC Cruises transport.” Those who tested positive were asymptomatic and were not traveling together.

While the company does not require vaccinations, it requires tests a few days before a cruise, just before boarding and midway through the voyage, spokesman Luca Biondolillo said earlier this month. He said the line has seen “a handful” of such cases since August.

“If anything, this is another demonstration that the protocol works,” he said.

On the Celebrity ship, the passengers who tested positive were sharing a room; the line had required everyone older than 16 to be fully vaccinated. They were asymptomatic, but tested positive during required tests near the end of the cruise.

Those passengers were kept in isolation and monitored by the medical team. The ship did contact tracing and sped up testing for close contacts.

“This situation demonstrates that our rigorous health and safety protocols work to protect our crew, guests and the communities we visit,” Celebrity said in a statement.

As requirements by the Centers for Disease Control and Prevention are updated and pandemic conditions change, cruise protocols change, too, making it difficult for passengers to know in advance exactly what their trip will be like or what they could expect if they or someone on their trip tested positive.

The future of some of those requirements is also unclear thanks to actions by Florida, home to the world’s busiest cruise ports and largest operators. A lawsuit filed by the state against the CDC sought to keep the agency from enforcing its rules for pandemic-era cruising. A federal judge said recently that the CDC’s rules would become recommendations as of July 18 for cruises in Florida but left room for the agency to come up with new, less restrictive guidelines that would still allow ships to sail in a timely way.

Cruise lines have not said whether they will change any protocols as a result.

Florida’s law that prohibits businesses from mandating proof of vaccination is also keeping cruise lines from taking the step that experts say would provide the best protection.

“The best I think that can happen is to basically have a fully vaccinated ship,” said Clare Rock, an infectious-disease physician and associate professor of medicine at Johns Hopkins School of Medicine. She has been providing expert advice to Carnival Corporation.

“When we have these large groups of fully vaccinated people together, the risks of someone actually getting sick or ill from covid is really, really, really minuscule,” she said. “Because when you have a group of close to fully protected people like that together, there’s not really significant virus to transmit from person to person.”