code: public long getPrice(Configuration configuration) {
          long total = 0;
          for (KnapsackItem knapsackItem : getKnapsackItems()) {
              if (configuration.valueAt(knapsackItem.getIndex()) == 1) {
                  total += knapsackItem.getPrice();
              }
          }
          return total;
      }
docs: Returns price of items in given configuration.
  
  Does not check for capacity.
  
  @param configuration configuration to calculate price of
  @return price of configuration