ScaleIntrons { @NotNull public static List<GenomeRegion> introns(@NotNull final List<? extends GenomeRegion> exons) { final List<GenomeRegion> result = Lists.newArrayList(); for (int i = 0; i < exons.size() - 1; i++) { GenomeRegion current = exons.get(i); GenomeRegion next = exons.get(i + 1); if (next.start() > current.end()) { result.add(GenomeRegions.create(current.chromosome(), current.end() + 1, next.start() - 1)); } } return result; } ScaleIntrons(@NotNull final List<GenomeRegion> introns); @NotNull static List<GenomeRegion> introns(@NotNull final List<? extends GenomeRegion> exons); @NotNull List<FusedExon> scaleIntronsInExons(@NotNull final List<FusedExon> exons); @NotNull List<ProteinDomain> scaleIntronsInProteinDomains(@NotNull final List<ProteinDomain> domains); @NotNull GenomeRegion scaleIntronsFromRegion(@NotNull final GenomeRegion region);  }
@Test public void testIntrons() { final List<GenomeRegion> introns = ScaleIntrons.introns(exons); assertEquals(2, introns.size()); assertEquals(create(2001, 3000), introns.get(0)); assertEquals(create(4601, 5600), introns.get(1)); }