@Internal
  public static String getFqName(
      String system, @Nullable String routine, Iterable<String> segments) {
    StringBuilder builder = new StringBuilder(system);
    if (!Strings.isNullOrEmpty(routine)) {
      builder.append(":").append(routine);
    }
    int idx = 0;
    for (String segment : segments) {
      if (idx == 0) {
        builder.append(":");
      } else {
        builder.append(".");
      }
      builder.append(wrapSegment(segment));
      ++idx;
    }
    return builder.toString();
  }
@Test
  public void testGetFqName() {
    Map<String, String> testCases =
        ImmutableMap.<String, String>builder()
            .put("apache-beam", "apache-beam")
            .put("`apache-beam`", "`apache-beam`")
            .put("apache.beam", "`apache.beam`")
            .put("apache:beam", "`apache:beam`")
            .put("apache beam", "`apache beam`")
            .put("`apache beam`", "`apache beam`")
            .put("apache\tbeam", "`apache\tbeam`")
            .put("apache\nbeam", "`apache\nbeam`")
            .build();
    testCases.forEach(
        (key, value) ->
            assertEquals("apache:" + value, Lineage.getFqName("apache", ImmutableList.of(key))));
    testCases.forEach(
        (key, value) ->
            assertEquals(
                "apache:beam:" + value,
                Lineage.getFqName("apache", "beam", ImmutableList.of(key))));
    testCases.forEach(
        (key, value) ->
            assertEquals(
                "apache:beam:" + value + "." + value,
                Lineage.getFqName("apache", "beam", ImmutableList.of(key, key))));
  }