static Collection<String> findIssueKeys(String input, Pattern pattern) {
        Matcher m = pattern.matcher(input);
        Set<String> issues = new HashSet<>();
        while (m.find()) {
            if (m.groupCount() >= 1) {
                String id = m.group(1);
                issues.add(id);
            }
        }
        return issues;
    }
@Test
    public void findIssueKeys() throws MalformedURLException {
        Pattern issuePattern = JiraSite.DEFAULT_ISSUE_PATTERN;
        Assert.assertEquals(Collections.singleton("JENKINS-43400"), BlueJiraIssue.findIssueKeys( "[JENKINS-43400] Print the error to the build log rather than", issuePattern));
        Assert.assertEquals(Collections.singleton("JENKINS-43400"), BlueJiraIssue.findIssueKeys("JENKINS-43400 Print the error to the build log rather than", issuePattern));
        Assert.assertEquals(Collections.singleton("JENKINS-43400"), BlueJiraIssue.findIssueKeys("foo/JENKINS-43400 Print the error to the build log rather than", issuePattern));
        Assert.assertEquals(new HashSet(Arrays.asList("TEST-123", "EXAMPLE-123", "JENKINS-43400")),
                            BlueJiraIssue.findIssueKeys("foo/JENKINS-43400 TEST-123 [EXAMPLE-123] Print the error to the build log rather than", issuePattern));
    }