StringConstructorConverter implements Converter { public Object convert(Class destClass, Object srcObj) { String result = (String)stringConverter.convert(destClass, srcObj); try { Constructor constructor = destClass.getConstructor(String.class); return constructor.newInstance(result); } catch (NoSuchMethodException e) { return result; } catch (Exception e) { throw new ConversionException(e); } } StringConstructorConverter(DateFormatContainer dateFormatContainer); Object convert(Class destClass, Object srcObj);  }
@Test public void testNoConstructor() { Object result = converter.convert(ArrayList.class, "A"); assertEquals("A", result); }