Well, it works for Starbucks. So why can’t McDonald’s also sell packaged versions of its McCafe coffee line in US supermarkets?

The struggling fast-food giant will begin testing just that idea next year in a deal with Kraft. The tests will include packages of whole bean and ground coffee as well as “single-cup” options, which typically include K-cups for Green Mountain Coffee Roasters’ popular Keurig brewer. Test markets and pricing were not disclosed, Crain’s Chicago Business noted.

“We want to work with McDonald’s to help consumers enjoy McCafe premium coffee in the comfort and convenience of their own homes,” Kraft Foods CEO Tony Vernon told analysts on a conference call, disclosing the test for the first time. Kraft will handle the marketing and distribution of the McDonald’s brand coffee. McDonald’s said in a statement it was “building on the momentum of our McCafe beverages in our restaurants by expanding these options,” according to the publication.

Such a move could hardly be unexpected. For several years, quick-serve genres that previously were very distinct have been changing to resemble one another more as they add product lines that complement the basic brand: McCafe and now Mighty Wings at McDonald’s, for example, and tea and La Boulange bakery goods—as well as a fledgling yogurt brand shared with Dannon—at Starbucks.

Specifically in packaged coffee, relatively new brands in the supermarket aisle that used to be mainly the province of quick-serve or foodservice include Dunkin’ Donuts and Starbucks, alongside long-time brands like Kraft-owned Gevalia, originally a mail-order product.

Meanwhile, sales at McDonald’s restaurants have gotten a big boost from its introduction of McCafe beverages, which include coffee and espresso drinks like those popularized by Starbucks. And last year, McDonald’s did begin selling packaged coffee at some of its outlets in Canada. A McDonald’s spokesperson said the chain regularly conducts market tests, adding: “We are building on the momentum of our McCafe beverages in our restaurants by expanding these options…to grocery stores and other retail locations.”

Part of the appeal of the deal for Kraft has to be that it could be a nice way to get back at Starbucks. Starbucks announced it was ending its packaged coffee retail partnership with Kraft in late 2010. Kraft sued to stop Starbucks from ending the contract, but a court ruled in Starbucks’s favor, Marketing Daily noted. Starbucks subsequently partnered with Green Mountain Coffee Roasters to create Starbucks K-Cups for the Keurig system, while Starbucks also launched its own brewing system, Verismo. The brand has since engaged in a heated grocery battle with premium-brand Gevalia, which has attempted to target the cafe brand with “taste test” ads and social media comparisons. It, too, recently launched K-cups to better compete with Starbucks.