test_class.declarator: random = new JavaUtilRandomNumberGenerator()
test_class.original_string: JavaUtilRandomNumberGenerator random = new JavaUtilRandomNumberGenerator();
test_class.type: JavaUtilRandomNumberGenerator
test_class.var_name: random
test_class.file: core/src/test/java/com/scottlogic/datahelix/generator/core/utils/JavaUtilRandomNumberGeneratorTest.java
test_class.identifier: JavaUtilRandomNumberGeneratorTest
test_case.body: @Test
      void nextBigDecimal_withNegativeDifferentScales_work() {
          BigDecimal lower = new BigDecimal("0.08");
          BigDecimal upper = new BigDecimal("0.1");
  
          Set<BigDecimal> expected = SetUtils.setOf(lower, new BigDecimal("0.09"));
  
          assertTrue(Stream.generate(() -> random.nextBigDecimal(lower, upper))
              .limit(10)
              .allMatch(expected::contains));
      }
test_case.class_method_signature: JavaUtilRandomNumberGeneratorTest.nextBigDecimal_withNegativeDifferentScales_work()
test_case.full_signature: @Test void nextBigDecimal_withNegativeDifferentScales_work()
test_case.identifier: nextBigDecimal_withNegativeDifferentScales_work
test_case.invocations: setOf assertTrue allMatch limit generate nextBigDecimal
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void nextBigDecimal_withNegativeDifferentScales_work()
focal_class.declarator: random
focal_class.modifier: private final
focal_class.original_string: private final Random random;
focal_class.type: Random
focal_class.var_name: random
focal_class.file: core/src/main/java/com/scottlogic/datahelix/generator/core/utils/JavaUtilRandomNumberGenerator.java
focal_class.identifier: JavaUtilRandomNumberGenerator
focal_class.interfaces: implements RandomNumberGenerator
focal_class.class_method_signature: JavaUtilRandomNumberGenerator.JavaUtilRandomNumberGenerator()
focal_class.full_signature: public  JavaUtilRandomNumberGenerator()
focal_class.identifier: JavaUtilRandomNumberGenerator
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  JavaUtilRandomNumberGenerator()
focal_class.class_method_signature: JavaUtilRandomNumberGenerator.JavaUtilRandomNumberGenerator(long seed)
focal_class.full_signature: public  JavaUtilRandomNumberGenerator(long seed)
focal_class.identifier: JavaUtilRandomNumberGenerator
focal_class.modifiers: public
focal_class.parameters: (long seed)
focal_class.signature:  JavaUtilRandomNumberGenerator(long seed)
focal_class.class_method_signature: JavaUtilRandomNumberGenerator.nextInt()
focal_class.full_signature: @Override public int nextInt()
focal_class.identifier: nextInt
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int nextInt()
focal_class.class_method_signature: JavaUtilRandomNumberGenerator.nextInt(int bound)
focal_class.full_signature: @Override public int nextInt(int bound)
focal_class.identifier: nextInt
focal_class.modifiers: @Override public
focal_class.parameters: (int bound)
focal_class.return: int
focal_class.signature: int nextInt(int bound)
focal_class.class_method_signature: JavaUtilRandomNumberGenerator.nextLong(long lowerInclusive, long upperExclusive)
focal_class.full_signature: @Override public long nextLong(long lowerInclusive, long upperExclusive)
focal_class.identifier: nextLong
focal_class.modifiers: @Override public
focal_class.parameters: (long lowerInclusive, long upperExclusive)
focal_class.return: long
focal_class.signature: long nextLong(long lowerInclusive, long upperExclusive)
focal_class.class_method_signature: JavaUtilRandomNumberGenerator.nextDouble(double lowerInclusive, double upperExclusive)
focal_class.full_signature: @Override public double nextDouble(double lowerInclusive, double upperExclusive)
focal_class.identifier: nextDouble
focal_class.modifiers: @Override public
focal_class.parameters: (double lowerInclusive, double upperExclusive)
focal_class.return: double
focal_class.signature: double nextDouble(double lowerInclusive, double upperExclusive)
focal_class.class_method_signature: JavaUtilRandomNumberGenerator.nextBigDecimal(BigDecimal lowerInclusive, BigDecimal upperExclusive)
focal_class.full_signature: @Override public BigDecimal nextBigDecimal(BigDecimal lowerInclusive, BigDecimal upperExclusive)
focal_class.identifier: nextBigDecimal
focal_class.modifiers: @Override public
focal_class.parameters: (BigDecimal lowerInclusive, BigDecimal upperExclusive)
focal_class.return: BigDecimal
focal_class.signature: BigDecimal nextBigDecimal(BigDecimal lowerInclusive, BigDecimal upperExclusive)
focal_class.class_method_signature: JavaUtilRandomNumberGenerator.adjustToScale(BigDecimal decimal, int scale)
focal_class.full_signature: private BigInteger adjustToScale(BigDecimal decimal, int scale)
focal_class.identifier: adjustToScale
focal_class.modifiers: private
focal_class.parameters: (BigDecimal decimal, int scale)
focal_class.return: BigInteger
focal_class.signature: BigInteger adjustToScale(BigDecimal decimal, int scale)
focal_class.class_method_signature: JavaUtilRandomNumberGenerator.nextBigInteger(BigInteger lowerInclusive, BigInteger upperExclusive)
focal_class.full_signature: private BigInteger nextBigInteger(BigInteger lowerInclusive, BigInteger upperExclusive)
focal_class.identifier: nextBigInteger
focal_class.modifiers: private
focal_class.parameters: (BigInteger lowerInclusive, BigInteger upperExclusive)
focal_class.return: BigInteger
focal_class.signature: BigInteger nextBigInteger(BigInteger lowerInclusive, BigInteger upperExclusive)
focal_method.body: @Override
      public BigDecimal nextBigDecimal(BigDecimal lowerInclusive, BigDecimal upperExclusive) {
          int lowerScale = lowerInclusive.scale();
          int upperScale = upperExclusive.scale();
          int greatestScale = Math.max(lowerScale, upperScale);
          BigInteger lowerValue = adjustToScale(lowerInclusive, greatestScale);
          BigInteger upperValue = adjustToScale(upperExclusive, greatestScale);
  
          return new BigDecimal(nextBigInteger(lowerValue, upperValue), greatestScale);
      }
focal_method.class_method_signature: JavaUtilRandomNumberGenerator.nextBigDecimal(BigDecimal lowerInclusive, BigDecimal upperExclusive)
focal_method.full_signature: @Override public BigDecimal nextBigDecimal(BigDecimal lowerInclusive, BigDecimal upperExclusive)
focal_method.identifier: nextBigDecimal
focal_method.invocations: scale scale max adjustToScale adjustToScale nextBigInteger
focal_method.modifiers: @Override public
focal_method.parameters: (BigDecimal lowerInclusive, BigDecimal upperExclusive)
focal_method.return: BigDecimal
focal_method.signature: BigDecimal nextBigDecimal(BigDecimal lowerInclusive, BigDecimal upperExclusive)