JavaClassNames { public static Class<?> type(Object x) { if (x==null) return null; if (x instanceof Class) return (Class<?>)x; if (x instanceof TypeToken) return ((TypeToken<?>)x).getRawType(); return x.getClass(); }  static Class<?> type(Object x); static Class<?> componentType(Object x); static String superSimpleClassName(Class<?> t); static String superSimpleClassName(Object o); static String simpleClassName(Class<?> t); static String verySimpleClassName(Class<?> t); static String simpleClassName(Object x); static String simplifyClassName(String className); static String cleanSimpleClassName(Object x); static String cleanSimpleClassName(Class<?> x); static String packageName(Object x); static String packagePath(Object x); static String resolveName(Object context, String path); static String resolveClasspathUrl(Object context, String path); static StackTraceElement[] currentStackTraceCleaned(); static StackTraceElement currentStackElement(); static StackTraceElement callerStackElement(int depth); static String niceClassAndMethod(StackTraceElement st); static String callerNiceClassAndMethod(int depth); static String niceClassAndMethod();  }
@Test public void testType() { Assert.assertEquals(JavaClassNames.type(this), JavaClassNamesTest.class); Assert.assertEquals(JavaClassNames.type(JavaClassNamesTest.class), JavaClassNamesTest.class); }