package node; import java.lang.reflect.Method; public class CastingUtils { public static void cast(Method method, Object[] args) throws Throwable { Class[] methodParameterTypes = method.getParameterTypes(); if (methodParameterTypes.length != args.length) { throw new Exception("Method argument length mismatch. Expecting " + methodParameterTypes.length + " found " + args.length); } for (int i = 0; i