public static Iterable<SegmentId> iterateAllPossibleParsings(String segmentId)
  {
    List<String> splits = DELIMITER_SPLITTER.splitToList(segmentId);
    String probableDataSource = tryExtractMostProbableDataSource(segmentId);
    // Iterate parsings with the most probably data source first to allow the users of iterateAllPossibleParsings() to
    // break from the iteration earlier with higher probability.
    if (probableDataSource != null) {
      List<SegmentId> probableParsings = iteratePossibleParsingsWithDataSource(probableDataSource, segmentId);
      Iterable<SegmentId> otherPossibleParsings = () -> IntStream
          .range(1, splits.size() - 3)
          .mapToObj(dataSourceDelimiterOrder -> DELIMITER_JOINER.join(splits.subList(0, dataSourceDelimiterOrder)))
          .filter(dataSource -> dataSource.length() != probableDataSource.length())
          .flatMap(dataSource -> iteratePossibleParsingsWithDataSource(dataSource, segmentId).stream())
          .iterator();
      return Iterables.concat(probableParsings, otherPossibleParsings);
    } else {
      return () -> IntStream
          .range(1, splits.size() - 3)
          .mapToObj(dataSourceDelimiterOrder -> {
            String dataSource = DELIMITER_JOINER.join(splits.subList(0, dataSourceDelimiterOrder));
            return iteratePossibleParsingsWithDataSource(dataSource, segmentId);
          })
          .flatMap(List::stream)
          .iterator();
    }
  }
public static Iterable < SegmentId > iterateAllPossibleParsings ( String segmentId ) { List < String > splits = DELIMITER_SPLITTER . splitToList ( segmentId ) ; String probableDataSource = tryExtractMostProbableDataSource ( segmentId ) ; if ( probableDataSource != null ) { List < SegmentId > probableParsings = iteratePossibleParsingsWithDataSource ( probableDataSource , segmentId ) ; Iterable < SegmentId > otherPossibleParsings = ( ) -> IntStream . range ( 1 , splits . size ( ) - 3 ) . mapToObj ( dataSourceDelimiterOrder -> DELIMITER_JOINER . join ( splits . subList ( 0 , dataSourceDelimiterOrder ) ) ) . filter ( dataSource -> dataSource . length ( ) != probableDataSource . length ( ) ) . flatMap ( dataSource -> iteratePossibleParsingsWithDataSource ( dataSource , segmentId ) . stream ( ) ) . iterator ( ) ; return Iterables . concat ( probableParsings , otherPossibleParsings ) ; } else { return ( ) -> IntStream . range ( 1 , splits . size ( ) - 3 ) . mapToObj ( dataSourceDelimiterOrder -> { String dataSource = DELIMITER_JOINER . join ( splits . subList ( 0 , dataSourceDelimiterOrder ) ) ; return iteratePossibleParsingsWithDataSource ( dataSource , segmentId ) ; } ) . flatMap ( List :: stream ) . iterator ( ) ; } }
Returns a (potentially empty) lazy iteration of all possible valid parsings of the given segment id string into
{@code SegmentId} objects.

Warning: most of the parsing work is repeated each time {@link Iterable#iterator()} of this iterable is consumed,
so it should be consumed only once if possible.