code: public static Object invokeMethod(Class<?> type,Object instance,String methodName,Class<?>[] inputTypes,Object[] input)
      {
          Method method=null;
          try
          {
              //get method
              method=type.getDeclaredMethod(methodName,inputTypes);
          }
          catch(Exception exception)
          {
              throw new FaxException("Unable to extract method: "+methodName+" from type: "+type,exception);
          }
  
          //set accessible
          method.setAccessible(true);
  
          Object output=null;
          try
          {
              //invoke method
              output=method.invoke(instance,input);
          }
          catch(Exception exception)
          {
              throw new FaxException("Unable to invoke method: "+methodName+" of type: "+type,exception);
          }
          
          return output;
      }
docs: This function invokes the requested method.
  
  @param   type
  The class type
  @param   instance
  The instance
  @param   methodName
  The method name to invoke
  @param   inputTypes
  An array of input types
  @param   input
  The method input
  @return  The method output