When Keri Hogan was in college, she decided she wanted to serve the city where she grew up. She wanted to be a Boston police officer.

Hogan became a cadet. She loved the work and applied to become an officer. She says she didn’t think twice when the application process required she give a snippet of hair to be drug tested. But the test came back positive for cocaine.

“I was devastated. I was completely devastated,” Keri Hogan said. “They’re telling me that this test is positive and I’m like, ‘No way. There’s no way that this could even possibly be.'”

Hogan says she’s never used cocaine. She remembers asking the Boston Police to redo the test and being told that was not an option.

Hogan sued. Her case is one of numerous lawsuits charging that the hair drug test is ineffective and racially biased.

Today, one of those cases is going before Massachusetts’ highest court. The test has been derided by critics as unreliable and racially biased for more than a decade, but the city is still using it.

Here is a look at the issue, the concerns, and the science.

Why use a hair drug test?

Using hair to test for drugs has been done widely since the 1980s. Big city police departments and major employers rely on hair drug testing to make sure their workforce is drug-free.

There are two major reasons hair is used instead of urine or sweat or saliva.

First, hair stores a record of drug exposure stretching back many months, whereas a urine drug test only shows drug use for the last handful of days. So, with a hair drug test, a drug user would not be able to stop using for a few days and pass the test.

Second, hair drug tests are harder to cheat. When someone gives a urine sample, they often produce it in private, so there’s the chance they dilute the sample or substitute in someone else’s urine. Not so with the hair drug test. The specimen can be observed throughout the collection process.

And yes, someone who is bald can still do a hair drug test. The hair is just taken from other parts of the body.

Is the hair drug test unreliable and racially biased?

“Hair testing measures exposure. Exposure means use as well as contact with drugs.”

David Kidwell, a scientist at the Naval Research Lab in Washington, D.C., says this distinction between use and exposure is the crux of the issue.

He says people might be shocked to learn that residue from drugs can be anywhere, like on our money or in public places. Drug remnants have even been found on desks in elementary schools.

"You can be exposed to drugs, you can get it on the surface of your hair, they will bind to the hair and they will make you look like a long-time drug user when it’s just mere contact with the drug.”

Kidwell says if you have a child or partner who uses drugs or you move into an apartment where drugs had historically been used, you might be exposed to drugs, even if you never used them, and on a hair drug test you could look like a drug user.

Kidwell says there are two other big issues. First, drugs like cocaine, opiates and heroin seem to bind to the melanin in your hair and darker hair has more melanin.

“There have been studies where an individual had both black hair and gray hair and they find that the drug binds far more to the black hair than it does to the gray hair,” said Kidwell.

The second issue is that certain hair products used mainly by African-Americans make it more likely drugs in the environment will bind to your hair.

Kidwell explains the oil in the hair product “coats the hair, protecting the hair from the moisture in the environment. But because many of these drugs like to stick to oily surfaces, that's how they get from the environment to the surface of the hair.”

“The hair care products contain humectants to hydrate the hair,” Kidwell continues. “That allows the drugs to penetrate from the oil into the hair and bind to the protein in the hair and the melanin in the hair.”

These factors suggest that even African-Americans spending time in the same environment as non-African Americans could be more likely to receive a false positive result in a hair drug test.

Is there a solution?

Despite enumerating concerns with the hair drug test, Kidwell doesn’t think it should be thrown out.

Instead, he has a proposal: Hair drug testing should be used as a screening. If you fail, instead of being summarily dismissed or officially reprimanded, Kidwell thinks you should take regular and random urine drug tests.

What’s happening with the lawsuits?

There are multiple different lawsuits going on. Keri Hogan is part of a federal lawsuit that has been winding its way through the courts for more than a decade.

That case is focused on the racially biased nature of the test. A key component of their argument: In the first several years of using the hair drug test in the BPD, African Americans were four times more likely to test positive for cocaine than Caucasian officers. That was odd because, as Kidwell explains, “there’s no reason to believe that population had a higher drug use rate.”

The case being heard today by the Massachusetts Supreme Judicial Court is a state case. It is focused more on the test being unreliable than being racially biased.

It involves a man — Michael Gannon — who, like Hogan, was a cadet and then applied to become a police officer. He didn’t get very far because he failed the hair drug test.

The Boston Police Department (BPD) did not let him proceed in the application process, despite having tested negative while a cadet and despite immediately getting an additional hair test that was also negative. The BPD has a strict policy that eliminates applicants with a positive drug test.

The Civil Service Commission ruled in Gannon’s favor, saying the hair test is too unreliable. However, a Superior Court judge then reversed that decision. And now, Gannon has appealed his case to Massachusetts’ highest court.

What are the arguments on each side?

The continued use of the hair drug test “really calls into question how sincere the city is when it says that it's committed to diversity in the police department," said Oren Sellstrom of Lawyers for Civil Rights. He represents Hogan.

Sellstrom says the city’s refusal to stop using the test has cost Boston taxpayers many millions of dollars in back pay and legal fees.

“What's worse is the human toll that is taken it has destroyed officer's lives when they have been falsely branded as drug users,” he adds.

Both the City of Boston and the Boston Police Department declined to comment for this story citing ongoing litigation. And Psychemedics Corporation — the Acton-based company the city contracts with to perform the test — did not respond to multiple requests for comment.

However, the case now before the Commonwealth’s Supreme Judicial Court, also went before the Civil Service Commission in 2014. During the hearing, Devin Taylor, then head of Human Relations at the BPD, said she fully trusted the results of the hair drug test.

The lawyer asked: “You believe without equivocation that a positive drug test — for cocaine, let’s be specific here — is absolutely 100 percent reliable?” Taylor answered: “Yes.”

In front of the Supreme Judicial Court today, a lawyer for the Boston Police Department, Helen Litsas confirmed that position, saying the hair drug test they use "is an objective test that is being used by a third party, accredited laboratory."

Representatives of Psychemedics Corp. testified during the 2014 hearing, pointing out that their test is approved by the Food and Drug Administration and used by police departments from New York to Chicago to Los Angeles.

The company said they have figured out how to distinguish between drug use and drug exposure. They say it involves an extensively washing the hair and then testing the wash.

However, naval researcher David Kidwell says Psychemedics hasn't let outside scientists evaluate their hair drug test.

Which side is the City of Boston on?

At the same time as the City of Boston and BPD are defending their use of the hair drug test in court — and continuing to use the test — they are in a legal battled with Psychemedics Corp. in which they question the tests reliability.

It all goes back to the city and the BPD trying recoup legal fees and hold Psychemedics legally responsible for the back pay owed after a judge ruled in favor of officers who had been fired because of positive tests. The price tag is in the millions.

The result is that the city and BPD are claiming in one lawsuit that “the hair drug test is accurate and reliable.”

And in their legal battle with Psychemedics, the city argues: "There are no universal industry standards controlling the performance of hair testing" and "substantial parts of the laboratory methodologies, including Psychemedics, are hidden behind claims of competitive proprietary interest."

The BPD pays Psychemedics more than $100,000 a year for drug testing.

The city of Boston declined to comment citing the ongoing litigation.