Fixed Stock.java logic to check for invalid prices in historicalPriceMap instead of counting entries