Alignments { public static long length(final Range<Long> range) { checkClosedOpen(range); return Math.max(0L, range.upperEndpoint() - range.lowerEndpoint()); } 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 testLengthNullRange() { length((Range<Long>) null); }
@Test(expected=IllegalArgumentException.class) public void testLengthOpenRange() { length(Range.open(2L, 4L)); }
@Test(expected=IllegalArgumentException.class) public void testLengthClosedRange() { length(Range.closed(2L, 4L)); }
@Test(expected=IllegalArgumentException.class) public void testLengthSingletonRange() { length(Range.singleton(2L)); }
@Test public void testLengthZero() { assertEquals(0L, length(Range.closedOpen(0L, 0L))); }
@Test public void testLengthOne() { assertEquals(1L, length(Range.closedOpen(0L, 1L))); }
@Test public void testLengthFromZero() { assertEquals(43L, length(Range.closedOpen(0L, 43L))); }
@Test public void testLengthFromOne() { assertEquals(42L, length(Range.closedOpen(1L, 43L))); }
@Test(expected=NullPointerException.class) public void testLengthNullRanges() { length((Iterable<Range<Long>>) null); }
@Test(expected=NullPointerException.class) public void testLengthRangesNullRange() { length(Collections.singleton((Range<Long>) null)); }
@Test(expected=IllegalArgumentException.class) public void testLengthRangesOpenRange() { length(Collections.singleton(Range.open(2L, 4L))); }
@Test(expected=IllegalArgumentException.class) public void testLengthRangesClosedRange() { length(Collections.singleton(Range.closed(2L, 4L))); }
@Test(expected=IllegalArgumentException.class) public void testLengthRangesSingletonRange() { length(Collections.singleton(Range.singleton(2L))); }
@Test public void testLengthEmptyRanges() { assertEquals(0L, length(Collections.<Range<Long>>emptySet())); }
@Test public void testLengthSingletonZeroRanges() { assertEquals(0L, length(Collections.singleton(Range.closedOpen(0L, 0L)))); }
@Test public void testLengthSingletonOneRanges() { assertEquals(1L, length(Collections.singleton(Range.closedOpen(0L, 1L)))); }
@Test public void testLengthSingletonFromZeroRanges() { assertEquals(43L, length(Collections.singleton(Range.closedOpen(0L, 43L)))); }
@Test public void testLengthSingletonFromOneRanges() { assertEquals(42L, length(Collections.singleton(Range.closedOpen(1L, 43L)))); }
@Test public void testLengthRanges() { assertEquals(43L, length(ranges)); }
@Test public void testLengthRangeSet() { assertEquals(43L, length(rangeSet.asRanges())); }