Sorted with following snippet - it is not most elegant way but works given the constraints
$dic=%FIND(opReturnType,"Dictionary")%
%If $dic!="-1"%
$note="TODO://Replace: with java.util.Map "
$note+=%opReturnType%
$t=%opReturnType%
$pos=%FIND($t,",")%
$dict=%LEFT($t,$pos)%
$ty=%REPLACE($t,$dict,"")%
$typ=%TRIM_LEFT($ty,",")%
$typp=%TRIM_RIGHT($typ,">")%
$type=%TRIM($typp)%
$lowerBound="0"
$upperBound="*"
%endIf%