harbor run -t openthoughts/tasktrove-mix-h2-language-proportional-mix-h2-lang-proportional-0060harbor download openthoughts/tasktrove-mix-h2-language-proportional-mix-h2-lang-proportional-0060Task Description: Implement the Reflection Utility
Implement the Reflection utility class that provides various reflective operations on Java classes, including the following functionalities:
isMarkerInterface:
java.lang.Object, except for default methods.Class<?> clazz representing the class to check.true if clazz is a marker interface, otherwise returns false.maybeWrap:
Class<?> clazz.Class<?> that might be a wrapped version of the input class.findConstructor:
Class<T> type and a varargs parameter of Class<?>... parameterTypes.Constructor<T> that matches the parameters.findDeclaredConstructor:
findConstructor, but it should only look for declared constructors.Class<T> type and varargs of Class<?>... parameterTypes.Constructor<T> that matches the parameters.singleAccessibleConstructor:
Class<T> type.Constructor<T> that is accessible.instantiate:
Class<T> clazz.T.instantiate (with Constructor):
Constructor<T> ctor and Object... args (parameters for the constructor).T.supertypes:
Type<?> bottom.Set<Type<?>> containing all supertypes.defaultValueOf:
Class<? extends Annotation> annotationType and a String attribute.Object representing the default value.allAnnotations:
AnnotatedElement.AnnotatedElement e.List<Annotation> containing all annotations.allAnnotationsByType:
AnnotatedElement.AnnotatedElement e and a Class<T> type.List<T> containing all annotations of the specified type.findMethod:
Class<?> target, a String methodName, and varargs of Class<?>... argTypes.Method that matches the criteria.invoke:
Method method, an Object target, and varargs of Object... args.Object resulting from the method invocation.findField:
Class<?> type and a String fieldName.Field representing the found field.allDeclaredFieldsOf:
Class<?> type.List<Field> containing all declared fields.setField:
Field field, an Object target, an Object value, and a boolean suppressProtection.jdk9OrBetter:
true if the JDK version is 9 or better, otherwise returns false.singleAbstractMethodOf:
Class<?> rawClass.Method representing the single abstract method or null if none found.reflectionException:
Exception ex.RuntimeException that wraps the original exception.annotatedComponentTypes:
AnnotatedType annotatedType.List<AnnotatedType> comprising the component types.Place your implementation in /app/. Ensure to include unit tests for the methods to verify their correctness and functionality.