public void setPrice(Pizza obj, int index) { BigDecimal price = BigDecimal.valueOf(index); obj.setPrice(price); }