### Question:
Util { public static String sourceClassName(Class<?> clazz) { return sourceClassName(clazz, null); } private  Util(); static void copy(InputStream in, OutputStream out); static String copyToString(InputStream in); static boolean isSet(@Nullable String s); static String escapeJava(String text); static String escapeHtmlXml(String text); static String getTemplate(Class<?> clazz); static String getLine(String s, int lineNumber); static String getCompileExceptionMessageWithoutLocation(CompileException compileException); static String primitiveToRefType(String clazz); static boolean isPrimitive(String clazz); static String sourceClassName(Class<?> clazz); static String sourceClassName(Field field); static String sourceClassName(Method method); static String sourceClassName(Class<?> clazz, @Nullable Type genericType); static String getArrayClass(String type); static Class<?> tryLoadClass(String type); static Method findMethod(Class<?> c, String methodName, int nArgs); @Nullable static Method findMethod(Class<?> c, String methodName, int nArgs, boolean forLambda); @SuppressWarnings("unchecked") static Map<K, V> map(Object... keyValuePairs); @SafeVarargs static List<T> list(T... items); @SafeVarargs static Set<T> set(T... items);  }### Answer:
@Test public void testSourceClassName() { assertThat(sourceClassName(String.class)).isEqualTo("java.lang.String"); assertThat(sourceClassName(Inner.class)).isEqualTo("ngoy.core.UtilTest.Inner"); assertThat(sourceClassName(SubInner.class)).isEqualTo("ngoy.core.UtilTest.Inner.SubInner"); assertThat(sourceClassName(Sub$Inner.class)).isEqualTo("ngoy.core.UtilTest.Inner.Sub$Inner"); }
@Test public void testArrays() throws Exception { assertThat(sourceClassName(getReturnType("getObj"))).isEqualTo("java.lang.Object"); assertThat(sourceClassName(getReturnType("getObjArray"))).isEqualTo("java.lang.Object[]"); assertThat(sourceClassName(getReturnType("getObjArrayArray"))).isEqualTo("java.lang.Object[][]"); }
@Test public void testGenerics() throws Exception { assertThat(sourceClassName(TestItf.class.getMethod("getList"))).isEqualTo("java.util.List<java.lang.String>"); assertThat(sourceClassName(TestItf.class.getMethod("getListArray"))).isEqualTo("java.util.List<java.lang.String[]>"); assertThat(sourceClassName(TestItf.class.getMethod("getMap"))).isEqualTo("java.util.Map<java.lang.String[], ngoy.model.Person>"); }