ClassUtils { public static List<Method> getAllMethods(Class clazz) { List<Method> all = new ArrayList<Method>(); for (Class<?> c = clazz; c != Object.class && c != null; c = c.getSuperclass()) { Method[] methods = c.getDeclaredMethods(); for (Method method : methods) { int mod = method.getModifiers(); if (Modifier.isNative(mod)) { continue; } method.setAccessible(true); all.add(method); } } return all; }  static Class forName(String className); static Class forName(String className, boolean initialize); static Class forName(String className, ClassLoader cl); static List<Method> getAllMethods(Class clazz); static List<Field> getAllFields(Class clazz); static T newInstance(Class<T> clazz); static T newInstanceWithArgs(Class<T> clazz, Class<?>[] argTypes, Object[] args); static Object getDefaultPrimitiveValue(Class clazz); static T getDefaultWrapperValue(Class<T> clazz); static String getMethodKey(String interfaceName, String methodName); static boolean isAssignableFrom(Class<?> interfaceClass, Class<?> implementClass);  }
@Test public void getAllMethods() throws Exception { List<Method> methods = ClassUtils.getAllMethods(TestBean.class); Assert.assertTrue(methods.size() >= 8); }