class ReflectionUtil {
    private static Map<String, Method> methodCache = new ConcurrentHashMap<String, Method>();
    private static Map<String, Field> fieldCache = new ConcurrentHashMap<String, Field>();

    public static Object invoke(Class<?> clazz, Object instance, String name, Class<?>[] parameterTypes, Object[] args) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        String key = clazz.getName() + name;

        Method method = methodCache.get(key);
        if (method == null) {
            method = clazz.getMethod(name, parameterTypes);

            methodCache.put(key, method);
        }

        return method.invoke(instance, args);
    }

    public static Object getValue(Class<?> clazz, Object instance, String name) throws NoSuchFieldException, IllegalAccessException {<FILL_FUNCTION_BODY>}
}

        String key = clazz.getName() + name;

        Field field = fieldCache.get(key);
        if (field == null) {
            field = clazz.getDeclaredField(name);
            field.setAccessible(true);

            fieldCache.put(key, field);
        }

        return field.get(instance);
    
<no_super_class>