code: public static Object exec(Method method, String[] paramNames, Map<String,?> params, Object instance) throws Throwable {
      
      Object[] paramValues = new Object[paramNames.length];
  
      for(int c=0; c < paramNames.length; ++c) {
        paramValues[c] = params.get(paramNames[c]);
      }
      
      try {
        return method.invoke(instance, paramValues);
      }
      catch (IllegalAccessException e) {
        //Shouldn't happen
        throw new RuntimeException(e);
      }
      catch (IllegalArgumentException e) {
        throw new InvocationException("invalid arguments", e, null);
      }
      catch (InvocationTargetException e) {
        throw e.getTargetException();
      }
      
    }
docs: Invokes the given method mapping named parameters to positions based on a
  given list of parameter names.
  
  @param method Method to invoke
  @param paramNames Positioned list of parameter names to map direct mapping
  @param params Named parameters to use
  @param instance Instance to invoke method on
  @return Result of method invocation
  @throws Throwable