JexlNumericFunctions implements ExpressionContextVisitor { public String randomPositiveFloat(Object owhole, Object odecimal) { int whole = FunctionHandler.getInt(owhole); int decimal = FunctionHandler.getInt(odecimal); StringBuilder output = new StringBuilder(); output.append(rnd.nextInt(8) + 1); for (int i = 0; i < whole - 1; i++) { output.append(rnd.nextInt(9)); } output.append("."); for (int i = 0; i < decimal; i++) { output.append(rnd.nextInt(9)); } return output.toString(); }  @Override void visit(JexlContext context); String mod(Object num, Object mod); String add(Object... values); String subtract(Object... values); String random(Object omin, Object omax); String random(Object omax); String randomPositiveWhole(Object olength); String randomNegativeWhole(Object olength); String randomPositiveFloat(Object owhole, Object odecimal); String randomNegativeFloat(Object owhole, Object odecimal); String toInt(String num);  }
@Test @Tag(TestGroups.FUNCTIONAL) public void testRandomPositiveFloat() { String random = variables.evaluate("#{numericFunctions.randomPositiveFloat(5, 3)}"); assertNotNull(random); assertTrue(random.length() == 9); random = variables.evaluate("#{numericFunctions.randomPositiveFloat(two_int, three_float)}"); assertNotNull(random); assertTrue(random.length() == 6); }