Alignments { public static List<Long> lengths(final Iterable<Range<Long>> ranges) { checkNotNull(ranges); List<Long> lengths = new ArrayList<Long>(); for (Range<Long> range : ranges) { lengths.add(length(range)); } return lengths; } private  Alignments(); static long length(final Range<Long> range); static List<Long> lengths(final Iterable<Range<Long>> ranges); static long length(final Iterable<Range<Long>> ranges); static long maximumLength(final Iterable<Range<Long>> ranges); static int count(final Iterable<Range<Long>> ranges); static List<Long> starts(final Iterable<Range<Long>> ranges); static List<Long> ends(final Iterable<Range<Long>> ranges); static List<Range<Long>> gaps(final GappedSymbolList gappedSymbols); static List<Range<Long>> matches(final AlignmentPair alignmentPair); static List<Range<Long>> mismatches(final AlignmentPair alignmentPair);  }
@Test(expected=NullPointerException.class) public void testLengthsNull() { lengths(null); }
@Test public void testLengthsEmpty() { lengths(Collections.<Range<Long>>emptySet()); }
@Test public void testLengths() { List<Long> lengths = lengths(ranges); assertEquals(4, lengths.size()); assertEquals(Long.valueOf(0L), lengths.get(0)); assertEquals(Long.valueOf(1L), lengths.get(1)); assertEquals(Long.valueOf(43L), lengths.get(2)); assertEquals(Long.valueOf(42L), lengths.get(3)); }
@Test public void testLengthsRangeSet() { List<Long> lengths = lengths(rangeSet.asRanges()); assertEquals(1, lengths.size()); assertEquals(Long.valueOf(43L), lengths.get(0)); }