public static <R> R callInstanceMethod(final Object instance, final String methodName, ClassParameter<?>... classParameters) {
    """
	Reflectively call an instance method on an object.
	
	@param instance Target object.
	@param methodName The method name to call.
	@param classParameters Array of parameter types and values.
	@param <R> The return type.
	@return The return value of the method.
    """
    try {
      final Class<?>[] classes = ClassParameter.getClasses(classParameters);
      final Object[] values = ClassParameter.getValues(classParameters);

      return traverseClassHierarchy(instance.getClass(), NoSuchMethodException.class, new InsideTraversal<R>() {
        @Override
        @SuppressWarnings("unchecked")
        public R run(Class<?> traversalClass) throws Exception {
          Method declaredMethod = traversalClass.getDeclaredMethod(methodName, classes);
          declaredMethod.setAccessible(true);
          return (R) declaredMethod.invoke(instance, values);
        }
      });
    } catch (InvocationTargetException e) {
      if (e.getTargetException() instanceof RuntimeException) {
        throw (RuntimeException) e.getTargetException();
      }
      if (e.getTargetException() instanceof Error) {
        throw (Error) e.getTargetException();
      }
      throw new RuntimeException(e.getTargetException());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
public static <R> R callInstanceMethod(final Object instance, final String methodName, ClassParameter<?>... classParameters) {
    try {
      final Class<?>[] classes = ClassParameter.getClasses(classParameters);
      final Object[] values = ClassParameter.getValues(classParameters);

      return traverseClassHierarchy(instance.getClass(), NoSuchMethodException.class, new InsideTraversal<R>() {
        @Override
        @SuppressWarnings("unchecked")
        public R run(Class<?> traversalClass) throws Exception {
          Method declaredMethod = traversalClass.getDeclaredMethod(methodName, classes);
          declaredMethod.setAccessible(true);
          return (R) declaredMethod.invoke(instance, values);
        }
      });
    } catch (InvocationTargetException e) {
      if (e.getTargetException() instanceof RuntimeException) {
        throw (RuntimeException) e.getTargetException();
      }
      if (e.getTargetException() instanceof Error) {
        throw (Error) e.getTargetException();
      }
      throw new RuntimeException(e.getTargetException());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
public static < R > R callInstanceMethod ( final Object instance , final String methodName , ClassParameter < ? > ... classParameters ) { try { final Class < ? > [ ] classes = ClassParameter . getClasses ( classParameters ) ; final Object [ ] values = ClassParameter . getValues ( classParameters ) ; return traverseClassHierarchy ( instance . getClass ( ) , NoSuchMethodException . class , new InsideTraversal < R > ( ) { @ Override @ SuppressWarnings ( "unchecked" ) public R run ( Class < ? > traversalClass ) throws Exception { Method declaredMethod = traversalClass . getDeclaredMethod ( methodName , classes ) ; declaredMethod . setAccessible ( true ) ; return ( R ) declaredMethod . invoke ( instance , values ) ; } } ) ; } catch ( InvocationTargetException e ) { if ( e . getTargetException ( ) instanceof RuntimeException ) { throw ( RuntimeException ) e . getTargetException ( ) ; } if ( e . getTargetException ( ) instanceof Error ) { throw ( Error ) e . getTargetException ( ) ; } throw new RuntimeException ( e . getTargetException ( ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Reflectively call an instance method on an object.

@param instance Target object.
@param methodName The method name to call.
@param classParameters Array of parameter types and values.
@param <R> The return type.
@return The return value of the method.
Reflectively call an instance method on an object .