@Override
public int compare(TemplateCall templateCall1, TemplateCall templateCall2)
{
Double diff = templateCall2.getPrecedence() - templateCall1.getPrecedence();
if (diff != 0) return diff.intValue();
<BUG>Double priority1 = templateCall1.getTemplate().getPriority() == null ?

Double.valueOf(0) : templateCall1.getTemplate().getPriority();
Double priority2 = templateCall2.getTemplate().getPriority() == null ?

Double.valueOf(0) : templateCall2.getTemplate().getPriority();</BUG>
diff = priority2 - priority1;

@Override
public int compare(TemplateCall templateCall1, TemplateCall templateCall2)
{
Double diff = templateCall2.getPrecedence() - templateCall1.getPrecedence();
