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_with2DbLocations_returns() {
    DbIssues.Location location1 = createDbLocation("comp_id_1");
    DbIssues.Location location2 = createDbLocation("comp_id_2");
    DbIssues.Locations issueLocations = DbIssues.Locations.newBuilder()
      .addFlow(createFlow(location1, location2))
      .build();

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

    assertThat(flows).hasSize(1);
    Flow singleFlow = flows.iterator().next();

    assertThat(singleFlow.getLocations()).hasSize(2);
    Map<String, Location> pathToLocations = singleFlow.getLocations()
      .stream()
      .collect(toMap(Location::getFilePath, identity()));

    assertLocationMatches(pathToLocations.get("file_path_comp_id_1"), location1);
    assertLocationMatches(pathToLocations.get("file_path_comp_id_2"), location2);

  }