During a Supreme Court hearing Wednesday on whether President Trump has the authority to ban immigrants from Muslim-majority countries on national security grounds, Justice Elena Kagan asked whether similar logic would protect an anti-Semitic president banning immigration from Israel.

During questioning of Solicitor General Noel Francisco, who was arguing for the Trump administration, Kagan asked about a hypothetical situation in which the president was a “vehement anti-Semite” who tried to ban immigrants from Israel, where the vast majority of non-American Jews live. Would he be able to do so, she asked, “even if in his heart of hearts he harbored animus?”

“This is an out-of-the-box kind of president in my hypothetical,” Kagan added.

According to The Washington Post, Francisco responded that it was a “tough hypothetical,” but the president had the authority to make such a ban if it was recommended by staff to solve a national security problem.

Francisco argued that Trump’s travel ban came after an extensive review process, and if Cabinet members of staffers knew the president was making the decision based on prejudice, they would be “duty bound” to resign or refuse to comply.

“No matter what standard you apply, this proclamation is constitutional,” Francisco insisted.

The court’s conservative justices, including frequent swing voter Justice Anthony Kennedy, appeared unwilling to question the president’s authority to make such decisions on national security grounds, Reuters reported.

Many Jewish groups filed “friend of the court” briefs to the Supreme Court. The Anti-Defamation League, Jewish Council for Public Affairs, T’ruah: The Rabbinic Call for Human Rights and major organs of the Reform movement filed a brief against the ban, as did the American Jewish Committee. The Zionist Organization of America filed in favor of the Trump administration.