### Question:
ParameterizableStringFactory extends AbstractFeatureFactory<T> { @Override public T random() { float[] newVals = new float[valueSets.length]; for (int i = 0; i < valueSets.length; i++) { newVals[i] = valueSets[i].random(); } return newInstance(newVals); } 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 testRandom() throws Exception { String paramString = "recip(rord(creationDate),[1,2,3],[10,100,1000],[$2])"; ParameterizableStringFactory<TestParam> fact = new ParameterizableStringFactory("bf", "0", TestParam.class, paramString); Matcher m = Pattern.compile( "^recip\\(rord\\(creationDate\\),([-\\.\\d]+),([-\\.\\d]+),([-\\.\\d]+)\\)").matcher(""); for (int i = 0; i < 100; i++) { TestParam t = fact.random(); m.reset(t.toString()); if (m.find()) { float f1 = getFloat(m, 1); float f2 = getFloat(m, 2); float f3 = getFloat(m, 3); assertTrue(f1 >= 1.0f && f1 <= 3.0f); assertTrue(f2 >= 10.0f && f2 <= 1000.0f); assertEquals(f2, f3, 0.000001); } else { fail( String.format(Locale.US, "couldn't find pattern in %s", t.toString()) ); } } }