code: public static String methodToString(final Class<?> type, final Method method) {
          final StringBuilder res = new StringBuilder();
          res.append(type.getSimpleName()).append('#').append(method.getName()).append('(');
          int i = 0;
          for (Class<?> param : method.getParameterTypes()) {
              if (i > 0) {
                  res.append(", ");
              }
              final Type generic = method.getGenericParameterTypes()[i];
              if (generic instanceof TypeVariable) {
                  // using generic name, because its simpler to search visually in code
                  res.append('<').append(((TypeVariable) generic).getName()).append('>');
              } else {
                  res.append(param.getSimpleName());
              }
              i++;
          }
          res.append(')');
          return res.toString();
      }
docs: Converts method signature to human readable string.
  
  @param type   root type (method may be called not from declaring class)
  @param method method to print
  @return string representation for method