### Question:
InjectionUtil { public static <T> T getField(Class<T> returnType, Class<?> targetClass, Object target, String field) { try { Field declaredField = targetClass.getDeclaredField(field); return AccessController.doPrivileged( new GetFieldPrivilegedAction<T>(declaredField, target)); } catch (NoSuchFieldException e) { throw new TransfuseInjectionException( "NoSuchFieldException Exception during field injection: " + field + " in " + target.getClass(), e); } catch (PrivilegedActionException e) { throw new TransfuseInjectionException("PrivilegedActionException Exception during field injection", e); } catch (Exception e) { throw new TransfuseInjectionException("Exception during field injection", e); } } private  InjectionUtil(); static T getField(Class<T> returnType, Class<?> targetClass, Object target, String field); static T getField(GenericType<T> returnType, Class<?> targetClass, Object target, String field); static void setField(Class<?> targetClass, Object target, String field, Object value); static T callMethod(Class<T> retClass, Class<?> targetClass, Object target, String method, Class[] argClasses, Object[] args); static T callMethod(GenericType<T> retClass, Class<?> targetClass, Object target, String method, Class[] argClasses, Object[] args); static T callConstructor(Class<T> targetClass, Class[] argClasses, Object[] args); static T callConstructor(GenericType<T> targetClass, Class[] argClasses, Object[] args); static final String GET_FIELD_METHOD; static final String SET_FIELD_METHOD; static final String CALL_METHOD_METHOD; static final String CALL_CONSTRUCTOR_METHOD; }### Answer:
@Test public void testGetField(){ Target target = new Target(); target.setValue(TEST_VALUE); String value = InjectionUtil.getField(String.class, Target.class, target, "value"); assertEquals(TEST_VALUE, value); }