}
  public int compareTo(Object other)  {    if (other instanceof Template)      {        Template t = (Template) other;        int d = t.precedence - precedence;        if (d != 0)          {            return d;          }        double d2 = t.priority - priority;        if (d2 != 0.0d)          {            return (int) Math.round(d2 * 1000.0d);          }      }    return 0;  }