### Question:
ClassUtils { public static Class<?> forName(String[] packages, String className) { try { return classForName(className); } catch (ClassNotFoundException e) { if (packages != null && packages.length > 0) { for (String pkg : packages) { try { return classForName(pkg + "." + className); } catch (ClassNotFoundException e2) { } } } throw new IllegalStateException(e.getMessage(), e); } } private  ClassUtils(); static Object newInstance(String name); static Class<?> forName(String[] packages, String className); static Class<?> forName(String className); static Class<?> classForName(String className); static Class<?> getBoxedClass(Class<?> type); static Boolean boxed(boolean v); static Character boxed(char v); static Byte boxed(byte v); static Short boxed(short v); static Integer boxed(int v); static Long boxed(long v); static Float boxed(float v); static Double boxed(double v); static Object boxed(Object v); static boolean unboxed(Boolean v); static char unboxed(Character v); static byte unboxed(Byte v); static short unboxed(Short v); static int unboxed(Integer v); static long unboxed(Long v); static float unboxed(Float v); static double unboxed(Double v); static Object unboxed(Object v); static boolean isNotEmpty(Object object); static int getSize(Object object); static URI toURI(String name); static Class<?> getGenericClass(Class<?> cls); static Class<?> getGenericClass(Class<?> cls, int i); static boolean isBeforeJava5(String javaVersion); static boolean isBeforeJava6(String javaVersion); static String toString(Throwable e); static void checkBytecode(String name, byte[] bytecode); static String getSizeMethod(Class<?> cls); static String getMethodName(Method method, Class<?>[] parameterClasses, String rightCode); static Method searchMethod(Class<?> currentClass, String name, Class<?>[] parameterTypes); static String getInitCode(Class<?> type); static Map<K, V> toMap(Map.Entry<K, V>[] entries); static final String CLASS_EXTENSION; static final String JAVA_EXTENSION; }### Answer:
@Test public void testForName() { ClassUtils.forName(new String[]{"org.apache.dubbo.common.compiler.support"}, "HelloServiceImpl0"); }
@Test public void testForName1() { Assertions.assertThrows(IllegalStateException.class, () -> ClassUtils.forName(new String[]{"org.apache.dubbo.common.compiler.support"}, "HelloServiceImplXX")); }
@Test public void testForName2() { ClassUtils.forName("boolean"); ClassUtils.forName("byte"); ClassUtils.forName("char"); ClassUtils.forName("short"); ClassUtils.forName("int"); ClassUtils.forName("long"); ClassUtils.forName("float"); ClassUtils.forName("double"); ClassUtils.forName("boolean[]"); ClassUtils.forName("byte[]"); ClassUtils.forName("char[]"); ClassUtils.forName("short[]"); ClassUtils.forName("int[]"); ClassUtils.forName("long[]"); ClassUtils.forName("float[]"); ClassUtils.forName("double[]"); }