### Question:
TypeParameterResolver { public static Type resolveFieldType(Field field, Type srcType) { Type fieldType = field.getGenericType(); Class<?> declaringClass = field.getDeclaringClass(); return resolveType(fieldType, srcType, declaringClass); } private  TypeParameterResolver(); static Type resolveFieldType(Field field, Type srcType); static Type resolveReturnType(Method method, Type srcType); static Type[] resolveParamTypes(Method method, Type srcType);  }### Answer:
@Test public void testField_GenericField() throws Exception { Class<?> clazz = SubCalculator.class; Class<?> declaredClass = Calculator.class; Field field = declaredClass.getDeclaredField("fld"); Type result = TypeParameterResolver.resolveFieldType(field, clazz); assertEquals(String.class, result); }
@Test void testField_GenericField() throws Exception { Class<?> clazz = SubCalculator.class; Class<?> declaredClass = Calculator.class; Field field = declaredClass.getDeclaredField("fld"); Type result = TypeParameterResolver.resolveFieldType(field, clazz); assertEquals(String.class, result); }