MethodAccessImpl implements MethodAccess { public Object invokeDynamicObject(final Object object, final Object args) { if (args instanceof List) { return invokeDynamicList(object, (List) args); } else { return invokeDynamic(object, args); } } MethodAccessImpl();  MethodAccessImpl(Method method); List<List<AnnotationData>> annotationDataForParams(); Object invokeDynamicList(final Object object, List<?> args); Object invokeDynamicObject(final Object object, final Object args); @Override Object invokeDynamic(final Object object, final Object... args); Object invoke(Object object, Object... args); Object invokeBound(Object... args); @Override Object invokeStatic(Object... args); @Override MethodAccess bind(Object instance); @Override MethodHandle methodHandle(); @Override MethodAccess methodAccess(); @Override Object bound(); @Override ConstantCallSite invokeReducerLongIntReturnLongMethodHandle(T object); @Override Method method(); @Override int score(); @Override Iterable<AnnotationData> annotationData(); @Override boolean hasAnnotation(String annotationName); @Override AnnotationData annotation(String annotationName); @Override boolean isStatic(); @Override boolean isPublic(); @Override boolean isPrivate(); @Override MethodReturnAccess returnAccess(); @Override String name(); @Override Class<?> declaringType(); @Override Class<?> returnType(); @Override boolean respondsTo(Class<?>[] parametersToMatch); @Override boolean respondsTo(Object... args); @Override Class<?>[] parameterTypes(); @Override Type[] getGenericParameterTypes(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(MethodAccess o2); List<TypeType> paramTypeEnumList(); @Override List<MethodParamAccess> parameters(); final public Method method; }
@Test public void testInvokeDynamicObject() { Map<String, Employee> map = new HashMap<>(); map.put("key", new Employee("rick")); List<Employee> employees = new ArrayList<>(); employees.add(new Employee("geoff")); Tuple<String, Employee, List> tuple = new Tuple<>(); TestService testService = new TestService(); ClassMeta classMeta = ClassMeta.classMeta(TestService.class); final MethodAccess someMethod = classMeta.method("someMethod"); Object returnValue = someMethod.invokeDynamicObject(testService, Arrays.asList(employees, map, tuple)); assertTrue((Boolean) returnValue); assertTrue(testService.someMethodCalled.get()); }