PropertiesUtil { public static String toString(Object propValue, String defaultValue) { propValue = toObject(propValue); return (propValue != null) ? propValue.toString() : defaultValue; } private  PropertiesUtil(); static boolean toBoolean(Object propValue, boolean defaultValue); static String toString(Object propValue, String defaultValue); static long toLong(Object propValue, long defaultValue); static int toInteger(Object propValue, int defaultValue); static double toDouble(Object propValue, double defaultValue); static Object toObject(Object propValue); static String[] toStringArray(Object propValue); static String[] toStringArray(Object propValue, String[] defaultArray); @SuppressWarnings("unchecked") static void populate(Object instance, Map<String,?> config, boolean validate);  }
@Test public void testToString() { assertEquals("hallo", PropertiesUtil.toString("hallo", null)); assertEquals(this.toString(), PropertiesUtil.toString(null, this.toString())); final Map<String, Object> m = new HashMap<String, Object>(); m.put("1", 5); assertEquals(m.toString(), PropertiesUtil.toString(m, this.toString())); }