public static <T extends Annotation> List<T> getAnnotations(Class<?> targetClass,
			Class<T> annotationClass, List<T> result) {
		if (result == null) {
			result = new ArrayList<>();
		}
		T annotation = targetClass.getAnnotation(annotationClass);
		if (annotation != null) {
			result.add(annotation);
		}
		if (targetClass.getSuperclass() != null) {
			getAnnotations(targetClass.getSuperclass(), annotationClass, result);
		}
		return result;
	}
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