public double getTotalValue(ArrayList<Double> amounts) {
        double total = 0;
        if (amounts.size() < items.size()) {
            for (int i = amounts.size(); i < items.size(); i++) {
                amounts.add(0.0);
            }
        }
        for (int i = 0; i < amounts.size(); i++) {
            total += amounts.get(i) * items.get(i).getValue();
        }
        return total;
    }