### Question:
ParameterizableStringFactory extends AbstractFeatureFactory<T> { @Override public T mutate(T parameterizableString, double probability, double amplitude) { float[] values = getValues(parameterizableString); int numMutations = (int) FastMath.floor(amplitude * values.length); numMutations = (numMutations == 0) ? 1 : numMutations; for (int i = 0; i < values.length; i++) { if (MathUtil.RANDOM.nextDouble() <= probability) { values[i] = MathUtil.calcMutatedWeight(values[i], valueSets[i].getMin(), valueSets[i].getMax(), amplitude); } } return newInstance(values); } ParameterizableStringFactory(String name, String factoryId, Class clazz, String paramString); String getFactoryId(); @Override T random(); @Override List<T> permute(int maxSize); @Override T mutate(T parameterizableString, double probability, double amplitude); @Override Pair<T, T> crossover(T parentA, T parentB);  }### Answer:
@Test public void testMutate() throws Exception { String paramString = "recip(rord(creationDate),[1,2,3],[10,100,1000],[$2])"; TestParam t = new TestParam("bf", "0", "recip(rord(creationDate),1,100,100)"); ParameterizableStringFactory<TestParam> fact = new ParameterizableStringFactory("bf", "0", TestParam.class, paramString); int diffs = 0; for (int i = 0; i < 100; i++) { TestParam mutated = fact.mutate(t, 0.8, 0.8); float[] vals = mutated.getValues(); assertTrue(vals[0] >= 1.0f && vals[0] <= 3.0f); assertTrue(vals[1] >= 10f && vals[1] <= 1000f); if (!MathUtil.equals(1, mutated.getValues()[0], 0.1f) && !MathUtil.equals(100, mutated.getValues()[1], 0.1f)) { diffs++; } } assertTrue(diffs > 10); }