Segments { @NotNull static List<Segment> incrementOnChromosome(@NotNull final List<Segment> segments, @NotNull final List<Link> links, boolean showSimpleSvSegments) { final Map<String, Integer> trackMap = Maps.newHashMap(); final List<Segment> result = Lists.newArrayList(); int frame = -1; int currentTrack = 1; for (final Segment segment : segments) { if (segment.clusterId() == -1) { result.add(ImmutableSegment.builder().from(segment).track(0).build()); } else if (showSegment(showSimpleSvSegments, segment, links)) { final String chromosome = segment.chromosome(); if (!trackMap.containsKey(chromosome)) { currentTrack = 1; } else { currentTrack = trackMap.get(chromosome) + 1; } trackMap.put(chromosome, currentTrack); result.add(ImmutableSegment.builder().from(segment).track(currentTrack).frame(frame += 2).build()); } } return result; }  static double segmentPloidyBefore(final int track, @NotNull final GenomePosition position,
            @NotNull final List<Segment> segments); @NotNull static Segment entireChromosome(@NotNull final String sampleId, @NotNull final String chromosome); @NotNull static List<Segment> readTracks(@NotNull final String fileName); @NotNull static List<Segment> extendTerminals(long terminalDistance, @NotNull final List<Segment> segments,
            @NotNull final List<Link> links, @NotNull final List<GenomePosition> allPositions, boolean showSimpleSvSegments); @NotNull static List<Segment> addCentromeres(@NotNull final List<Segment> segments);  }
@Test public void testTrackStrategies() { final List<Segment> segments = Lists.newArrayList(createSegment("1"), createSegment("2"), createSegment("1")); final List<Segment> incrementOnChromosome = Segments.incrementOnChromosome(segments, Collections.emptyList(), false); assertEquals(3, incrementOnChromosome.size()); assertEquals(1, incrementOnChromosome.get(0).track()); assertEquals(1, incrementOnChromosome.get(1).track()); assertEquals(2, incrementOnChromosome.get(2).track()); }