public static List<Method> getMarkedMethods(Class<?> targetClass,
			Class<? extends Annotation> annotationClass, List<Method> methods,
			boolean includeParentClasses, Class<?>... paramClasses) {
		if (methods == null) {
			methods = new ArrayList<>();
		}

		if (includeParentClasses && targetClass.getSuperclass() != null) {
			getMarkedMethods(targetClass.getSuperclass(), annotationClass, methods,
				includeParentClasses, paramClasses);
		}
		methodloop: for (Method method : targetClass.getDeclaredMethods()) {
			if (method.getParameterCount() == paramClasses.length &&
				method.getAnnotation(annotationClass) != null) {
				Class<?>[] parameterTypes = method.getParameterTypes();
				if (parameterTypes.length != paramClasses.length) {
					continue;
				}
				for (int i = 0; i < parameterTypes.length; i++) {
					Class<?> methodParamClass = parameterTypes[i];
					if (!methodParamClass.isAssignableFrom(paramClasses[i])) {
						continue methodloop;
					}
				}
				method.setAccessible(true);
				methods.add(method);
			}
		}
		return methods;
	}
Returns a list of methods that have been marked with a specific annotation.

@param targetClass class to query
@param annotationClass annotation to search for
@param methods list to accumulate results into, or null to allocate new list.  Also returned
as the result of this function
@param includeParentClasses boolean flag, if true recurse into parent classes first
@param paramClasses list of parameters that the tagged methods should declare.  Methods
will be skipped if they don't match
@return list of found methods that match the annotation and param list
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/ReflectionHelper.java