architecture – DDD Modeling – Entity with generic and specific data

Suppose I am buying coffee. There are several types of coffee (A1, A2, A3), but sometimes I want to make a reference to all types of coffee (like if I had a coffee “grouped”). Considering DDD concepts, coffee A1 is different from all types of coffee, so that’s their identities and I need to reference both specific and generic Coffee Entity.

I thought I could map it like:

class Coffee{ 
  private CoffeeId id;
  @NotNull
  private Code code;
  private SubGroup subGroup; 
}

For coffee A1, its id would be “ca1”, for coffee A2 its id would be “ca2” and for generic coffee could be “cag” and subGroup attribute would be null.

Someone finds another way to transform these use cases into entities?