### Question:
Commodity implements Serializable { public int dosesPerVial() { return isVial() ? findDosesPerVial() : 1; } Commodity();  Commodity(String name);  Commodity(String id, String name);  Commodity(String name, Category category);  Commodity(String id, String name, Category category, boolean nonLGA, boolean isDevice, boolean isVaccine); String getName(); @Override boolean equals(Object o); @Override int hashCode(); void setCategory(Category category); StockItem getStockItem(); boolean isOutOfStock(); boolean isLGA(); int getStockOnHand(); StockItem reduceStockOnHandBy(int quantity); StockItem increaseStockOnHandBy(int quantity); String getOrderFrequency(); void setOrderFrequency(String orderFrequency); CommodityAction getCommodityAction(String activityType); int getMinimumThreshold(); int getMaximumThreshold(); boolean isBelowThreshold(); @Override String toString(); int calculateEmergencyPrepopulatedQuantity(); int getLatestValueFromCommodityActionByName(String actionName); int calculateRoutinePrePopulatedQuantity(); Integer getAMC(); void setIsDevice(boolean isDevice); void setIsVaccine(boolean isVaccine); boolean isVial(); int dosesPerVial(); List<CommodityAction> getCommodityActionsSaved(); Category getCategory(); boolean isDevice(); boolean isVaccine(); boolean isNonLGA(); String getId(); List<CommodityAction> getCommodityActions(); void setNonLGA(boolean nonLGA); void setId(String id); void setName(String name);  }### Answer:
@Test public void shouldReturnNumberOfDosesPerVial() throws Exception { Commodity commodity = new Commodity("BCG Vaccine 35_doses/vial"); assertThat(commodity.dosesPerVial(), is(35)); }
@Test public void shouldReturnCorrectNumberOfDosesPerVial() throws Exception { Commodity commodity = new Commodity("BCG Vaccine 5_doses/vial"); assertThat(commodity.dosesPerVial(), is(5)); }
@Test public void shouldReturnCorrectNumberOfDosesPerVialWhenCommodityIsNotVial() throws Exception { Commodity commodity = new Commodity("Panado"); assertThat(commodity.dosesPerVial(), is(1)); }