### Question:
VolumeLevelGenerator { public double generateRandomDecibleLevel(int min, int max){ if(min < 1){ min = 1; } if(max > DB_RANGE){ max = DB_RANGE; } if(min > max){ max = min; } Random random = new Random(); return 1.0 * (double)random.nextInt(max - min + 1) + min; }  List<Map<String, Double>> generatePotentialMixes(); Map<String, Double> generatePotentialMix(); double generateRandomDecibleLevel(int min, int max); final int DB_RANGE; final int NUM_OF_MIXES; }### Answer:
@Test public void randomNumber_shouldBeEqualToOrGreaterThanMin() { int numberOfTests = 100; for (int i = 0; i < numberOfTests; i++) { double randVolume = volumeLevelGenerator.generateRandomDecibleLevel(-9999, 5); assertThat(randVolume).isGreaterThanOrEqualTo(1); assertThat(randVolume).isLessThanOrEqualTo(15); } }
@Test public void randomNumber_shouldBeLessThanOrEqualToMax() { int numberOfTests = 100; for (int i = 0; i < numberOfTests; i++) { double randVolume = volumeLevelGenerator.generateRandomDecibleLevel(1, 9999); assertThat(randVolume).isGreaterThanOrEqualTo(1); assertThat(randVolume).isLessThanOrEqualTo(15); } }
@Test public void randomNumber_shouldEqualTarget(){ double randVolume = volumeLevelGenerator.generateRandomDecibleLevel(5, 5); assertThat(randVolume).isEqualTo(5); }