public void printItemsUtility() { String highBidder; for (int i = 0; i < Auctions.size(); i++) { // Iterate through the ArrayList of auctions generated by the scenario generator Auction auction = Auctions.get(i); if (auction.getHighBidder() == null) { highBidder = " "; } else { highBidder = auction.getHighBidder().getUserName(); } System.out.println( auction.getItem().getTitle() + " has a current high bid of $" + decFor.format(auction.getCurrentPrice()) + " and an rrp of $" + decFor.format(auction.getItem().getRrp()) + " giving it a buyer utility of $" + decFor.format(auction.getUtility()) + ". The high bidder is: " + highBidder); } System.out.println("\n"); }