public DefaultIssue forRule(RuleKey ruleKey) {
    this.ruleKey = ruleKey;
    return this;
  }
@Test
  public void build_issue_with_secondary_locations() {
    TextRange range1 = new DefaultTextRange(new DefaultTextPointer(1, 1), new DefaultTextPointer(1, 2));
    TextRange range2 = new DefaultTextRange(new DefaultTextPointer(2, 1), new DefaultTextPointer(2, 2));

    DefaultIssue issue = new DefaultIssue(project, storage)
      .at(new DefaultIssueLocation().on(inputFile))
      .addLocation(new DefaultIssueLocation().on(inputFile).at(range1).message("loc1"))
      .addLocation(new DefaultIssueLocation().on(inputFile).at(range2).message("loc2"))
      .forRule(RULE_KEY);

    assertThat(issue.flows())
      .extracting(Flow::type, Flow::description)
      .containsExactly(tuple(FlowType.UNDEFINED, null), tuple(FlowType.UNDEFINED, null));

    assertThat(issue.flows().get(0).locations()).hasSize(1);
    assertThat(issue.flows().get(1).locations()).hasSize(1);
  }