### Question:
ConfigUtils { public static Properties keyValueToProperties(Object... keyValues) { Preconditions.checkArgument(keyValues.length % 2 == 0); Properties properties = new Properties(); for (int i = 0; i < keyValues.length - 1; i += 2) { properties.setProperty(keyValues[i].toString(), keyValues[i+1].toString()); } return properties; } private  ConfigUtils(); static Config getDefault(); static Config overlayOn(Map<String,?> overlay, Config underlying); static String getOptionalString(Config config, String key); static List<String> getOptionalStringList(Config config, String key); static Double getOptionalDouble(Config config, String key); static void set(Map<String,Object> overlay, String key, Path path); static String serialize(Config config); static Config deserialize(String serialized); static String prettyPrint(Config config); static Properties keyValueToProperties(Object... keyValues);  }### Answer:
@Test public void tetKeyValuesToProperties() { assertEquals(new Properties(), ConfigUtils.keyValueToProperties()); Properties expected = new Properties(); expected.setProperty("foo", "1"); expected.setProperty("2.0", "bing"); assertEquals(expected, ConfigUtils.keyValueToProperties( "foo", 1, 2.0, "bing" )); }
@Test(expected = IllegalArgumentException.class) public void testBadKeyValuesToProperties() { ConfigUtils.keyValueToProperties("key"); }