### Question:
FeatureFactories { public FeatureFactory get(String fName) { return featureFactories.get(fName); } FeatureFactories(Map<String, FeatureFactory> featureSetMap); FeatureFactory get(String fName); @Override String toString(); Set<String> keySet(); Map<String, FeatureFactory> getFeatureFactories();  }### Answer:
@Test public void testSimpleQF() throws Exception { List<String> fields = new ArrayList<>(); fields.add("a"); fields.add("b^3.2"); fields.add("c^1.6"); fields.add("d"); List<Float> defaultWeights = new ArrayList<>(); defaultWeights.add(0.0f); defaultWeights.add(1.0f); defaultWeights.add(2.0f); WeightableListFeatureFactory qf = new WeightableListFeatureFactory<QF>( "qf", QF.class, fields, defaultWeights, 1,-1); for (int i = 0; i < 10; i++) { boolean foundAuthor = false; boolean foundContent = false; WeightableListFeature list = (WeightableListFeature)qf.random(); for (int j = 0; j < list.size(); j++) { WeightableField wf = list.get(j); if (wf.getFeature().equals("b")) { foundAuthor = true; assertEquals(3.2f, wf.getWeight(), 0.001); } else if (wf.getFeature().equals("c")) { foundContent = true; assertEquals(1.6f, wf.getWeight(), 0.001); } else { Float weight = wf.getWeight(); assertNotNull(weight); assertTrue(weight >= 0.0f && weight <= 10.0f); } } assertTrue(foundAuthor); assertTrue(foundContent); } List<Feature> permutations = qf.permute(200); assertEquals(14, permutations.size()); }