public boolean isTaintVulnerability(DefaultIssue issue) {
    return taintRepositories.contains(issue.getRuleKey().repository())
      && issue.getLocations() != null
      && !RuleType.SECURITY_HOTSPOT.equals(issue.type());
  }
@Test
  public void test_isTaintVulnerability() {
    DefaultIssue taintWithoutLocation = createIssueWithRepository("noTaintIssue", "roslyn.sonaranalyzer.security.cs")
      .toDefaultIssue();
    DefaultIssue taint = createIssueWithRepository("taintIssue", "roslyn.sonaranalyzer.security.cs")
      .setLocations(DbIssues.Locations.newBuilder()
        .setTextRange(DbCommons.TextRange.newBuilder().build())
        .build())
      .toDefaultIssue();
    DefaultIssue issue = createIssueWithRepository("standardIssue", "java")
      .setLocations(DbIssues.Locations.newBuilder()
        .setTextRange(DbCommons.TextRange.newBuilder().build())
        .build())
      .toDefaultIssue();
    DefaultIssue hotspot = createIssueWithRepository("hotspot", "roslyn.sonaranalyzer.security.cs",
      RuleType.SECURITY_HOTSPOT).toDefaultIssue();

    assertThat(underTest.isTaintVulnerability(taintWithoutLocation)).isFalse();
    assertThat(underTest.isTaintVulnerability(taint)).isTrue();
    assertThat(underTest.isTaintVulnerability(issue)).isFalse();
    assertThat(underTest.isTaintVulnerability(hotspot)).isFalse();
  }