ConversionUtils { public static <T> T convert(Object o, Class<T> clazz) { if (o == null) { return null; } return clazz.cast(UTILS_BEAN.get().convert(o, clazz)); }  static T convert(Object o, Class<T> clazz); static List<U> convertList(List<T> from, Class<U> clazz); static Map<K, V2> convertMap(Map<K, V1> from, Class<V2> clazz);  }
@Test public void testIntegerConversions() { Object o = 1; assertEquals(Integer.valueOf(1), ConversionUtils.convert(o, Integer.class)); assertEquals(Integer.valueOf(1), ConversionUtils.convert("1", Integer.class)); assertNull(ConversionUtils.convert("foo", Integer.class)); }