public Builder add(ItemType type, int qty) { qty = qty < 0 ? 1 : qty; inventory.add( new Pair<>(type, qty <= type.getMaxStackQuantity() ? qty : type.getMaxStackQuantity())); return this; }
public Builder add(ItemType type) { inventory.add(new Pair<>(type, type.getMaxStackQuantity())); return this; }