code: public static String getTitle(final String namePattern, final String methodName,
                                    final Object instance, final Object... parameters) {
          final String finalPattern = namePattern
                  .replaceAll("\\{method}", methodName)
                  .replaceAll("\\{this}", String.valueOf(instance));
          final int paramsCount = parameters == null ? 0 : parameters.length;
          final Object[] results = new Object[paramsCount];
          for (int i = 0; i < paramsCount; i++) {
              results[i] = arrayToString(parameters[i]);
          }
  
          return MessageFormat.format(finalPattern, results);
      }
docs: Generate title using name pattern. First step all "{method}" substrings will be replaced
  with given method name. Then replace all "{i}" substrings with i-th parameter.