### Question:
HyperParams { public static HyperParamValues<?> fromConfig(Config config, String key) { switch (config.getValue(key).valueType()) { case LIST: List<String> stringValues = config.getStringList(key); try { return range(Integer.parseInt(stringValues.get(0)), Integer.parseInt(stringValues.get(1))); } catch (NumberFormatException nfe) { } try { return range(Double.parseDouble(stringValues.get(0)), Double.parseDouble(stringValues.get(1))); } catch (NumberFormatException nfe) { } return unorderedFromValues(stringValues); case STRING: case NUMBER: String stringValue = config.getString(key); try { return fixed(Integer.parseInt(stringValue)); } catch (NumberFormatException nfe) { } try { return fixed(Double.parseDouble(stringValue)); } catch (NumberFormatException nfe) { } return unorderedFromValues(Collections.singletonList(stringValue)); default: throw new IllegalArgumentException("No valid parameter range for key " + key); } } private  HyperParams(); static HyperParamValues<Double> fixed(double fixedValue); static HyperParamValues<Double> range(double min, double max); static HyperParamValues<Double> around(double value, double step); static HyperParamValues<Integer> fixed(int fixedValue); static HyperParamValues<Integer> range(int min, int max); static HyperParamValues<Integer> around(int value, int step); static HyperParamValues<T> unorderedFromValues(Collection<T> values); static HyperParamValues<?> fromConfig(Config config, String key); static List<List<?>> chooseHyperParameterCombos(
      List<HyperParamValues<?>> ranges, String hyperParamSearch, int howMany);  }### Answer:
@Test public void testConfig() { Map<String,Object> overlay = new HashMap<>(); overlay.put("a", 1); overlay.put("b", 2.7); overlay.put("c", "[3,4]"); overlay.put("d", "[5.3,6.6]"); Config config = ConfigUtils.overlayOn(overlay, ConfigUtils.getDefault()); doTest(HyperParams.fromConfig(config, "a"), 1, Collections.singletonList(1)); doTest(HyperParams.fromConfig(config, "b"), 1, Collections.singletonList(2.7)); doTest(HyperParams.fromConfig(config, "c"), 2, Arrays.asList(3, 4)); doTest(HyperParams.fromConfig(config, "d"), 2, Arrays.asList(5.3, 6.6)); }