Here you can find the source of invoke(Method method, Object object, Object... arguments)
private static Object invoke(Method method, Object object, Object... arguments)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; import java.util.Arrays; public class Main { private static Object invoke(Method method, Object object, Object... arguments) { Object result = null;//from ww w .j av a2s . c om try { if (!method.isAccessible()) { method.setAccessible(true); } result = method.invoke(object, arguments); } catch (Exception ignored) { System.err.printf("%s method[arguments : %s] can't be invoked in object[%s]!\n", method.getName(), Arrays.asList(arguments), object); } return result; } }