### Question:
ClassUtils { public static <T> T loadInstanceOf(Class<T> clazz) { return loadInstanceOf(clazz.getName(), clazz); } private  ClassUtils(); static Class<T> loadClass(String className); static Class<? extends T> loadClass(String className, Class<T> superClass); static boolean classExists(String implClassName); static T loadInstanceOf(Class<T> clazz); static T loadInstanceOf(String implClassName, Class<T> superClass); static T loadInstanceOf(String implClassName,
                                     Class<T> superClass,
                                     Class<?>[] constructorTypes,
                                     Object[] constructorArgs);  }### Answer:
@Test public void testLoadInstanceOf() { assertInstanceOf(ClassUtils.loadInstanceOf(HashSet.class), HashSet.class); }
@Test public void testLoadInstanceOf2() { assertInstanceOf(ClassUtils.loadInstanceOf(HashSet.class.getName(), Set.class), HashSet.class); }
@Test public void testInstantiateWithArgs() { Number n = ClassUtils.loadInstanceOf(Integer.class.getName(), Number.class, new Class<?>[]{int.class}, new Object[]{3}); assertEquals(3, n.intValue()); }
@Test(expected = IllegalArgumentException.class) public void testNoSuchMethod() { ClassUtils.loadInstanceOf(Long.class.getName(), Long.class); }
@Test(expected = IllegalStateException.class) public void tesInvocationException() { ClassUtils.loadInstanceOf(String.class.getName(), String.class, new Class<?>[] { char[].class }, new Object[] { null }); }