public static boolean isValidTemplate(String template) {
    template = template.trim();

    if (template.indexOf('{') == -1) {
      return false;
    }

    // ending } must be the last character
    String s = template.trim();
    if (s.lastIndexOf('}') != s.length() - 1) {
      return false;
    }

    return getMethodSignature(template) != null && getMethodBody(template) != null;
  }
public static boolean isValidTemplate(String template)