The two teenage history buffs dressed up in military gear like so many times before for the seaside summer festival. One sported the green fatigues of the Red Army. The other donned the grayish uniform of the German Wehrmacht.

Only this time, they ended up in jail, charged with violating a new law banning public displays of communist and Nazi symbols.

Verdicts are expected Friday in a legal test for the disputed legislation pushed through Lithuania's Parliament in June amid growing concern over a resurgent Russia and lingering divisions with Moscow over the Soviet legacy in the Baltics.

The law, introduced 17 years after Lithuania and its Baltic neighbors emerged from a half-century of Soviet occupation, has angered Moscow because it equates the hammer and sickle with the swastika.

But it also faces criticism in Lithuania, where many have sympathized with Germanas Musychinas and Audrius Petreikis, the two high school students who were arrested in the port city of Klaipeda in August.

"We were not cheering for Hitler or Stalin," said Petreikis, 17, who was wearing the Nazi uniform.

"We were participating in the annual sea festival and wanted to show people what the soldiers who occupied our country many years ago looked like. Everybody enjoyed it, and many onlookers took pictures with us," he said.

The Soviet Union annexed Lithuania in 1940, though Russians claim the Soviet army liberated Lithuania — along with Baltic neighbors Estonia and Latvia — from Nazi Germany.

Nationalist lawmakers behind the legislation say people should be more sensitive to the dark legacy of the Soviets, who deported hundreds of thousands of Estonians, Latvians and Lithuanians to Siberian labor camps and Arctic coal mines.

"Of course this law may affect some people, but looking at the big picture, we should remember what is hiding behind these symbols — a brutal regime ... responsible for the deaths of millions in Lithuania and Europe," said Emanuelis Zingeris of the conservative Homeland Union party, which spearheaded the ban.

The party's anti-Russian stance seems to have boosted its popularity at a time of growing concern of Russia's ambitions following its invasion of Georgia, another former Soviet republic.