SAN JOSE (CBS SF) — A legal battle is brewing over police stings in public bathrooms as the San Jose Police Department is accused of unfairly singling out gay men for arrest.

Gay rights advocates call the undercover operations a form of entrapment.

READ MORE: UPDATE: Investigation Underway Into Fatal Freeway Shooting On I-580 In Oakland

As first reported by the San Jose Mercury News and also by San Jose Inside, from 2014 to 2015, San Jose police ran a sting operation where undercover officers talked with suspects, then cited or arrested two dozen people and charged them with, among other things, loitering near a bathroom with the intent to commit a lewd act.

The public bathroom is near the Guadalupe River in San Jose, and near a baseball diamond where kids play. The bathroom is apparently known to be a place where men pick up other men.

But with these arrests, the police department sparked what could be a huge civil rights battle.

Famed gay rights attorney Bruce Nickerson said he thinks San Jose police are targeting gay men and plans to file a class-action lawsuit, demanding San Jose police stop the sting operations.

Nickerson, who’s been defending these cases for three decades, says the arrests and the use of a decoy, are no good.

Nickerson said, “Because the decoy automatically makes every arrest invalid by generating in the mind of the defendant the reasonable belief that the decoy is interested and not likely to be offended.”

READ MORE: COVID: Bay Area Health Officials, Schools Prepare To Vaccinate Kids 5-11 As Authorization Looms

Nickerson says he’s pored over SJPD’s arrest records for similar sting operations over the years, and says gay men are being singled out, claiming it’s a blatant violation of the 14th Amendment, which grants equal protection under the law.

Nickerson said the department has not made any decoy arrests for male-female lewd conduct.

“It is the gay equivalent of stopping Jim Crow laws,” Nickerson said.

Gabrielle Antolovich, board president of the Billy DeFrank LGBTQ Community Center, said “It’s like a flashback to the 1980s.”

Antolovich said the police department can’t arrest their way out of this problem. “Arresting people does not change anything. But to have a dialogue and discussion about ‘OK, we have two different kinds of people using the same space. What are we going to do about that?’” she said.

The lawsuit will not only ask that the police department stop these stings, but will also ask for the arrests to be removed from the defendants’ records and a “modest” cash settlement.

MORE NEWS: COVID: Muni To Suspend 'Short' Line Service Citing Vaccine Mandate Staffing Issues

Nickerson has a successful track record of lawsuits related to these types of sting operations.