public List<Flow> convertFlows(String componentName, @Nullable DbIssues.Locations issueLocations) {
    if (issueLocations == null) {
      return Collections.emptyList();
    }
    return issueLocations.getFlowList().stream()
      .map(sourceFlow -> toFlow(componentName, sourceFlow))
      .collect(Collectors.toCollection(LinkedList::new));
  }
@Test
  public void convertFlows_with2FlowsSingleDbLocations_returnsCorrectFlow() {
    DbIssues.Location location1 = createDbLocation("comp_id_1");
    DbIssues.Location location2 = createDbLocation("comp_id_2");
    DbIssues.Locations issueLocations = DbIssues.Locations.newBuilder()
      .addFlow(createFlow(location1))
      .addFlow(createFlow(location2))
      .build();

    List<Flow> flows = flowGenerator.convertFlows(COMPONENT_NAME, issueLocations);

    assertThat(flows).hasSize(2).extracting(f -> f.getLocations().size()).containsExactly(1, 1);
    Map<String, DbIssues.Location> toDbLocation = Map.of(
      "file_path_" + location1.getComponentId(), location1,
      "file_path_" + location2.getComponentId(), location2);
    flows.stream()
      .map(actualFlow -> actualFlow.getLocations().iterator().next())
      .forEach(l -> assertLocationMatches(l, toDbLocation.get(l.getFilePath())));
  }