RuntimeUtil { public static String currentClassMethod() { StackTraceElement[] ste = new Exception().getStackTrace(); int ndx = (ste.length > 1) ? 1 : 0; StackTraceElement element = new Exception().getStackTrace()[ndx]; return element.getClassName() + "." + element.getMethodName(); }  static String currentClassMethod(); static String currentMethodName(); static String currentClassName(); static String currentNamespace(); static String classLocation(Class<?> clazz); static String classLocation();  }
@Test public void currentClassMethod() { assertEquals("com.baidu.unbiz.common.RuntimeUtilTest.currentClassMethod", RuntimeUtil.currentClassMethod()); }