Coffee sniffers

The coffee sniffers (German Kaffeeriecher or Kaffeeschnüffler) were a group of about 400 war invalids which were employed by the Kingdom of Prussia between 1781 and 1787 by decree of Frederick II (the Great). Their job was to literally sniff out the illegal roasting of coffee beans after a high luxury tax was instituted on coffee to raise funds, keep money in the country and to support the national producers and suppliers of beer brewed in Prussia as well as producers of chicory as a coffee substitute.
Besides Prussia, the Landgraviate of Hesse-Kassel also employed coffee sniffers to enforce a ban of coffee instituted in 1766 and tightened in 1774 by Frederick II, Landgrave of Hesse-Kassel.
Prussia.
Frederick's father, Frederick William I of Prussia, had declared coffee as well as chocolate, tea, sparkling wine and fruit ice cream to be luxury goods. This led to coffee becoming a common commodity with all swaths of the population, since offering coffee was seen as something special; by the mid-18th century, most Prussians regularly drank coffee. 
When, after the Seven Years' War, Prussia's treasury was empty, Frederick II raised the luxury tax on coffee to 150% of the sale price; a spinstress now had to work a full day to afford a cup of coffee. Frederick justified the taxes by saying that people could instead drink beer which he deemed healthier than coffee and which would support the local breweries while coffee led to money leaving the country. Frederick initially sought to ban coffee altogether in favour of chicory, a substitute that was produced domestically, but after realizing the futility of such a ban, the government instead in 1781 decided to monopolize coffee roasting. Frederick decreed that only state-owned roasting plants were allowed to roast coffee. Exceptions were made for nobility, soldiers in command positions, the clergy, industrialists and other privileged citizens. This led to merchants with concessions selling coffee for inflated prices. 
While some commoners turned to cheaper coffee substitutes made from wheat, corn, chicory or dried figs, many turned to smuggling of coffee beans, which were near undetectable before roasting. This led to workers even abandoning their old jobs in order to profit from smuggling. Frederick decided to employ 400 former soldiers, invalids of the Seven Years' War, as coffee sniffers to detect smuggled coffee being roasted or consumed. Citizens who were found to be in possession of illegal coffee had to pay large fines. Coffee sniffers wore military uniforms and conducted searches on people and houses. They were detested by the populace but well paid and received premiums for each smuggler they caught (a quarter of the fine was paid to the coffee sniffers). The ire caused by the coffee sniffers lasted well into the first quarter of the 19th century. The only officials hated more than coffee sniffers were wig sniffers (Perückenschnüffler) whose job it was to make sure people were wearing licensed wigs. 
After the death of Frederick, the state's monopoly on coffee was abolished in 1787, leading to the dissolution of the coffee sniffers.
Hesse-Kassel.
Although coffee sniffers are mostly associated with Prussia, contemporary sources also mention that in 1766, Frederick II, Landgrave of Hesse-Kassel, had outlawed coffee in the Landgraviate of Hesse-Kassel. Since the population continued drinking coffee, Frederick tightened the laws in 1774 and officials were dispatched to search people and houses to detect coffee being roasted or served.