MethodCache { public Method[] getMethods(final Class<?> clazz) { if (clazz == null) { return null; } return cache.get(ClassUtil.getFriendlyClassName(clazz), new Callable<Method[]>() { @Override public Method[] call() throws Exception { return ReflectionUtil.getAllMethodsOfClass(clazz, true); } }); } private  MethodCache(); static MethodCache getInstance(); Method[] getMethods(final Class<?> clazz); Method[] getInstanceMethods(final Class<?> clazz); Method[] getMethods(final Class<?> clazz, final Class<? extends Annotation> annotationClass); Method getMethod(final Class<?> clazz, String methodName, Class<?>...params); Method getInstanceMethod(final Class<?> clazz, String methodName, Class<?>...params); Method getMethod(final Class<?> clazz, final Class<? extends Annotation> annotationClass, String methodName,
            Class<?>...params);  }
@Test public void getMethods() { Method[] result = cache.getMethods(String.class); Method[] methods = ReflectionUtil.getAllMethodsOfClass(String.class); assertArrayEquals(result, methods); methodSize = result.length; result = cache.getMethods(AnnotationClass.class, AnnotationClass.Test.class); methods = ReflectionUtil.getAnnotationMethods(AnnotationClass.class, AnnotationClass.Test.class).toArray( new Method[0]); assertArrayEquals(result, methods); }