### Question:
ClassUtils { public static <T> Class<T> loadClass(String className) { try { @SuppressWarnings("unchecked") Class<T> theClass = (Class<T>) forName(className); return theClass; } catch (ClassNotFoundException cnfe) { throw new IllegalStateException("No valid " + className + " exists", cnfe); } } 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 testLoadClass() { assertSame(ArrayList.class, ClassUtils.loadClass(ArrayList.class.getName())); }
@Test public void testLoadClass2() { assertSame(ArrayList.class, ClassUtils.loadClass(ArrayList.class.getName(), List.class)); }
@Test(expected = IllegalStateException.class) public void testLoadNonExistentClass() { ClassUtils.loadClass("foobar"); }
@Test(expected = IllegalStateException.class) public void testLoadNonExistentClass2() { ClassUtils.loadClass("foobar", Number.class); }