private static MethodHandle BindCaller(MethodHandle target, Class hostClass) { MethodHandle cbmh = MethodHandleImpl.BindCaller(target, hostClass); if (target.VarargsCollector) { MethodType type = cbmh.Type(); int arity = type.ParameterCount(); return(cbmh.AsVarargsCollector(type.ParameterType(arity - 1))); } return(cbmh); }