@Override
    public String render(String text) {
        if (StringUtils.isBlank(text)) {
            return "";
        }
        if (regex.isEmpty() || link.isEmpty()) {
            Comment comment = new Comment();
            comment.escapeAndAdd(text);
            return comment.render();
        }
        try {
            Matcher matcher = Pattern.compile(regex).matcher(text);
            int start = 0;
            Comment comment = new Comment();
            while (hasMatch(matcher)) {
                comment.escapeAndAdd(text.substring(start, matcher.start()));
                comment.add(dynamicLink(matcher));
                start = matcher.end();
            }
            comment.escapeAndAdd(text.substring(start));
            return comment.render();
        } catch (PatternSyntaxException e) {
            LOGGER.warn("Illegal regular expression: {} - {}", regex, e.getMessage());
        }
        return text;
    }
@Test
    public void shouldReturnOriginalStringIfRegexDoesNotMatch() throws Exception {
        String link = "http://mingle05/projects/cce/cards/${ID}";
        String regex = "evo-(\\d+)";
        trackingTool = new DefaultCommentRenderer(link, regex);
        String toRender = "evo-abc: checkin message";

        String result = trackingTool.render(toRender);
        assertThat(result, is(toRender));
    }