Counting or summing values can easily be done by following the example below.

${set(count,0)}
#{for links}
#{if (%{'${Links[n].LinkType}'.equals('tests')})}
${set(count,%{${count} + 1})}
#{end}
#{end}