Starbucks has won the dismissal of a U.S. lawsuit accusing the coffee chain of overcharging customers by underfilling lattes and mochas to reduce milk costs.

U.S. District Judge Yvonne Gonzalez Rogers on Friday found a lack of evidence that Starbucks cheats customers by making its cups too small, using "fill-to" lines on baristas' pitchers that are too low, and instructing baristas to skimp on ingredients, such as by leaving a quarter-inch of space atop drinks.

The Oakland, California-based judge also rejected a claim that milk foam added to lattes and mochas should not count toward advertised volumes. She said reasonable customers expect foam to take up some volume, and the plaintiffs conceded that foam is an essential ingredient in their drinks.

"Accordingly, plaintiffs fail to show that lattes contain less than the promised beverage volume represented on Starbucks' menu boards," Rogers wrote.

Lawyers for the plaintiffs did not immediately respond on Sunday to requests for comment. Starbucks did not immediately respond to similar requests.

Lattes contain espresso, steamed milk and foam. Mochas are similar but also contain a chocolate sauce.

Siera Strumlauf and Benjamin Robles, both of California, and Brittany Crittenden of New York had accused Starbucks in their proposed nationwide class action of fraud and false advertising by underfilling 12-, 16- and 20-ounce lattes by about 25 percent, causing unspecified damages.

Starbucks countered that its cups hold more than the advertised number of ounces, and that the "fill-to" lines provide guidance to baristas as to how much cold milk, which expands when steamed, to pour into pitchers.

In 2016, two federal judges dismissed separate lawsuits accusing the Seattle-based company of cheating customers who bought iced beverages, finding that reasonable customers would understand that ice counts toward their drinks' contents.

The case is Strumlauf et al v Starbucks Corp, U.S. District Court, Northern District of California, No. 16-01306.