MethodCache { public Method[] getInstanceMethods(final Class<?> clazz) { if (clazz == null) { return null; } return cache.get(ClassUtil.getFriendlyClassName(clazz) + ".instance", new Callable<Method[]>() { @Override public Method[] call() throws Exception { return ReflectionUtil.getAllInstanceMethods(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 getInstanceMethods() { Method[] result = cache.getInstanceMethods(String.class); Method[] fields = ReflectionUtil.getAllInstanceMethods(String.class); assertArrayEquals(result, fields); instanceMethodSize = result.length; result = cache.getInstanceMethods(AnnotationClass.class); fields = ReflectionUtil.getAllInstanceMethods(AnnotationClass.class); assertArrayEquals(result, fields); getMethods(); assertTrue(methodSize > 0); assertTrue(instanceMethodSize > 0); assertTrue(methodSize > instanceMethodSize); }