Hopefully fixed the problem in the Simulation that was causing the outOfBounds exception to occur, also added some unit tests for Simulation mostly trying to test the totalMarginalProfit method.