private static String getMethodSignature(String template) {
    final String trimmed = template.trim();
    String s = trimmed.startsWith("/*") ? after(trimmed, "*/") : trimmed;

    final int indexOf = s.indexOf('{');
    if (indexOf > 0) {
      return s.substring(0, indexOf).trim();
    }

    StringBuilder signature = new StringBuilder();

    String[] lines = s.split("\n");
    for (String line : lines) {
      line = line.trim();
      if (line.startsWith("@")) {
        continue;
      }
      signature.append(line);
      if (line.indexOf('{') > -1) {
        break;
      }
    }

    // remove last {
    String result = signature.toString();
    return result.substring(0, result.lastIndexOf("{"));
  }
private static String getMethodSignature(String template)