### Question:
ProductCategoryUsageSimulator { public ProductCategoryUsageTrajectory simulate(double initialTime, double initialAmount) throws Exception { ProductCategoryUsageTrajectory trajectory = new ProductCategoryUsageTrajectory(initialTime, initialAmount); while(trajectory.getLastAmount() > 0.0) { step(trajectory); } return trajectory; } ProductCategoryUsageSimulator(double dailyUsageRate, double amountUsedAverage,
			double amountUsedVariance, SeedFactory seedFactory); ProductCategoryUsageTrajectory simulate(double initialTime, double initialAmount);  }### Answer:
@Test public void testSimulate() throws Exception { SeedFactory seedFactory = new SeedFactory(1234); ProductCategoryUsageSimulator simulator = new ProductCategoryUsageSimulator(2.0, 1.0, 1.0, seedFactory); ProductCategoryUsageTrajectory trajectory = simulator.simulate(0.0, 30.0); assertEquals(0.0, trajectory.getLastAmount(), 0.0001); Pair<Double, Double> previousEntry = trajectory.getStep(0); for(int i = 1; i < trajectory.size(); i++) { Pair<Double, Double> entry = trajectory.getStep(i); assertTrue(previousEntry.getLeft() <= entry.getLeft()); assertTrue(previousEntry.getRight() >= entry.getRight()); previousEntry = entry; } }