Brooklyn is the new Guantánamo.

Just ask Ali Yasin Ahmed, Madhi Hashi, and Mohamed Yusuf.

The three alleged members of Al-Shabab were traveling from Somalia to Yemen last year when they were grabbed by what court papers describe only as “local authorities” and turned over to the Americans.

Until recently, the trio would have been declared enemy combatants and locked up at Guantánamo.

Instead they found themselves in the borough of Jay-Z and hipsters.

Since the three weren’t accused of any crimes committed within the United States, federal law dictated that they had to be prosecuted in the jurisdiction where they first landed. The FBI flew them into John F. Kennedy International Airport, which is in the Eastern District of New York. The agents did so understanding that this meant the case would necessarily be handled by federal prosecutors in Brooklyn, who have considerable experience with terrorism cases.

In anticipation of the trio’s arrival, a Brooklyn federal grand jury had been presented with evidence concerning their alleged involvement with Al-Shabab. They were said to have been part of what authorities describe as an “elite suicide bombing squad.” They were further alleged to have acquired “substantial knowledge regarding an Al-Shabab research and development department that was developing chemical weapons for use.”

There seems to have been nothing to indicate they specifically targeted the United States, and none of the three are American. Ahmed, 27, and Yusuf, 29, are Swedish citizens. Hashi, 23, was British until he was stripped of his citizenship in a rare official sanction.

But under U.S. law, no connection to the United States is necessary for them to be charged with providing material support to a terrorist organization. They are alleged to have done so from 2008 to 2012. There was an additional firearms charge and, if convicted, they would face a minimum of 30 years in prison, a maximum of life.

Indictment 12-661 was handed down in November. They were arraigned the next day as accused criminals, no differently than if they had been charged with drug dealing or bank robbery or any other crime. They pleaded not guilty. They were denied bail not because they had been declared enemy combatants but because, as might be the case for anybody, they were deemed both a flight risk and a danger to the community.

The three were accorded the same rights as any defendant, including legal counsel. Yusuf was represented by Ephraim Savitt, who notes that the first time the trio “had the pleasure” of visiting Brooklyn “was when they were brought here in chains.

“It’s a hell of a way to be introduced to Brooklyn,” he says.

He adds, “Between all the hipsters and the Nets and now we have Guantánamo! This place is hopping and we’re on the way now, baby.”

Then came something unlikely ever to happen in Guantánamo. Hashi’s initial attorney, Harry Batchelder, decided to send his client a Taliban joke in an apparent effort to cheer him up. The joke, as written by Batchelder and first reported by the New York Daily News, involves a Taliban who is almost dead of thirst in the desert when he comes upon a British soldier who is selling neckties. The correction officers confiscated it as not qualifying as a legal document and therefore contraband under the “Special Administrative Measures” under which the three are incarcerated. The defendants do not likely find anything funny about being held in solitary and kept separate from each other even when they have the same court date. They are, however, permitted to make the occasional phone call and given halal food.

On Monday, even as Kenyan security forces battled with the Al-Shabab gunmen who went on a murder spree in a Nairobi mall, two of the defendants in Brooklyn briefly appeared before Judge Sandra Townes. Hashi came in first, wearing a white kufi and looking gaunt, reportedly from a hunger strike. He remained silent during the brief hearing.

After Hashi was led out, Ahmed was brought in, also wearing a white knit kufi, also silent. His lawyer, Susan Kellman, complained that due to sequester cuts, the correction officer who had been detailed to provide her client with his meals on the weekends was no longer there and Ahmed sometimes went without food. The prosecutor promised to look into it and subsequently informed the court that Ahmed had missed only a lunch, on the day he was in court. Kellman says she is unconvinced.

The third defendant, Yusuf, is due in court September 30. The government has described the three as “dangerous and influential” figures, but none of them look particularly threatening. Some observers might wonder what they are doing in Brooklyn when they are not accused of specifically targeting the United States, much less New York. But the slaughter in Kenya made clear the threat that Al-Shabab presents. Who murders a world-famous poet and pregnant public-health worker along with dozens of other innocents simply because they are not Muslim?

The three have been given 45 days to accept a plea offer that the government has not yet specified. The alternative is to go to trial. The government says its evidence includes electronic intercepts of Ahmed and Yusuf discussing plans to join Al-Shabab, as well as recordings after all three of them had allegedly joined the fighting in Somalia. There is also said to be a recording in which Ahmed allegedly describes himself as an associate of the suicide bomber who dressed up as a woman, complete with veil, and walked into a medical-school graduation in a Mogadishu hotel in 2009. The attack killed two dozen innocents, including doctors, medical students, and prominent educators, a crime against all humankind.

Should Hashi choose to go to trial, it will be his right to repeat the protestations of innocence he made while still living in Britain, when he complained that MI5 had been pressuring him to become an informer. He subsequently insisted that he went to Somalia only to visit a sick grandmother.

However it plays out, nobody will be able to say the three have been denied the rights our law says are due everybody, even alleged terrorists.

They cannot say they were mistreated when their biggest complaint is they might have missed some meals.

And because it will all have been done in the way of Brooklyn, not Guantánamo, we will be a step closer to who we really are.

That, of course, is the last thing any terrorist wants us to be.