### Question:
ClassUtils { public static Class<?> forName(String name) throws ClassNotFoundException { return forName(name, getClassLoader()); }  static Class<?> forNameWithThreadContextClassLoader(String name); static Class<?> forNameWithCallerClassLoader(String name, Class<?> caller); static ClassLoader getCallerClassLoader(Class<?> caller); static ClassLoader getClassLoader(Class<?> clazz); static ClassLoader getClassLoader(); static Class<?> forName(String name); static Class<?> forName(String name, ClassLoader classLoader); static Class<?> resolvePrimitiveClassName(String name); static String toShortString(Object obj); static String simpleClassName(Class<?> clazz); static boolean isPrimitive(Class<?> type); static boolean isSimpleType(Class<?> type); static Object convertPrimitive(Class<?> type, String value); static boolean isTypeMatch(Class<?> type, String value); static Set<Class<?>> getAllSuperClasses(Class<?> type, Predicate<Class<?>>... classFilters); static Set<Class<?>> getAllInterfaces(Class<?> type, Predicate<Class<?>>... interfaceFilters); static Set<Class<?>> getAllInheritedTypes(Class<?> type, Predicate<Class<?>>... typeFilters); static boolean isAssignableFrom(Class<?> superType, Class<?> targetType); static boolean isPresent(String className, ClassLoader classLoader); static Class<?> resolveClass(String className, ClassLoader classLoader); static boolean isGenericClass(Class<?> type); static final String ARRAY_SUFFIX; static final Set<Class<?>> SIMPLE_TYPES; }### Answer:
@Test public void testForName1() throws Exception { assertThat(ClassUtils.forName(ClassUtilsTest.class.getName()) == ClassUtilsTest.class, is(true)); }
@Test public void testForName2() throws Exception { assertThat(ClassUtils.forName("byte") == byte.class, is(true)); assertThat(ClassUtils.forName("java.lang.String[]") == String[].class, is(true)); assertThat(ClassUtils.forName("[Ljava.lang.String;") == String[].class, is(true)); }
@Test public void testForName3() throws Exception { ClassLoader classLoader = Mockito.mock(ClassLoader.class); ClassUtils.forName("a.b.c.D", classLoader); verify(classLoader).loadClass("a.b.c.D"); }