Keri Hogan was about to become a police officer when she submitted a sample of her hair to the city of Boston for testing. The city, in turn, gave it to a company called Psychemedics, which washed the hair, dissolved it, and used gas chromatography and mass spectrometry—chemical analysis techniques—to check it twice over for evidence of cocaine. Hogan’s hair tested positive.

Boston police officers whose hair tests positive for drugs usually have two options: admit their substance abuse problems and agree to a stint in rehabilitation, or relinquish their position. But Hogan, who finished her police training prior to 2005, says that she has never used cocaine; when she sent her hair to a private company for more testing, it came back negative. Now, she and nine other black police officers are suing the city of Boston, saying that the practice of testing hair for drugs is discriminatory. Because of the chemistry behind the test, they say, it unfairly targets dark hair. The bench trial for the case began on March 12, and may have long-lasting consequences for the future of drug testing.

The hair test was developed in the late ‘60s, when an Austrian chemist named Werner Baumgartner decided to piggyback on the work of his wife. Annette Baumgartner was working at the Aerospace Corporation, trying to figure out what toxins might be ingested by onlookers during a shuttle launch, and Werner realized that he could look for drug exposure with the strategies she developed. Substances floating around the blood eventually get incorporated into the hair as it grows—either through tiny blood vessels or the oil and sweat glands that surround the hair follicle—and drugs found inside the hair itself, he realized, would be harder to cheat on than urine or saliva tests. They’d linger longer in the sample, too.

Baumgartner demonstrated the full force of the procedure when he used it to identify opiate painkillers in the poet John Keats’ hair, which the lab received from a rare book collection at the University of Texas at Austin. After a Time Magazine story about the Keats test, several businessmen approached Baumgartner with the intent to start a company, and Psychemedics was born.

In 1985, a navy chemist named David Kidwell was tasked with studying the test’s effectiveness—and soon, he began to have reservations. In 1993, he published the results of an experiment in which he soaked the hair in a mix of cocaine derivative and water, then washed it repeatedly before performing the drug test. Despite his attempts to remove the external contamination, the tests came back positive.

Baumgartner argued that Kidwell had used the wrong wash procedure; the test was still reliable. But Kidwell and his research partner lashed back: “At the current level of understanding, the presence of drugs in an individual's hair indicates exposure to that compound,” they wrote. “Attempting to expand this observation into the suggestion of use or long-term abuse of a drug would seem unwarranted at this time.”

Thus began a scientific back-and-forth that has continued to this day. Scientists like Kidwell argue that both external and ingested cocaine binds to melanin in the hair. People with black hair have more melanin in general, but especially more of the subtype eumelanin, which studies have shown binds particularly well with cocaine and amphetamines. (Gray hair doesn’t have much of any type of melanin, so if you want to get away with using cocaine, aging may be your best bet.) And researchers disagree over whether hair can ever be washed clean of any and all drugs it could have come into contact with from the outside.