Alignments { public static int count(final Iterable<Range<Long>> ranges) { int count = 0; for (Range<Long> range : ranges) { checkClosedOpen(range); count++; } return count; } 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 testCountNull() { count(null); }
@Test public void testCountEmpty() { assertEquals(0, count(Collections.<Range<Long>>emptySet())); }
@Test(expected=NullPointerException.class) public void testCountNullRange() { count(Collections.singleton((Range<Long>) null)); }
@Test(expected=IllegalArgumentException.class) public void testCountOpen() { count(Collections.singleton(Range.open(2L, 4L))); }
@Test(expected=IllegalArgumentException.class) public void testCountClosed() { count(Collections.singleton(Range.closed(2L, 4L))); }
@Test(expected=IllegalArgumentException.class) public void testCountSingleton() { count(Collections.singleton(Range.singleton(2L))); }
@Test public void testCountOne() { assertEquals(1, count(Collections.singleton(Range.closedOpen(0L, 1L)))); }
@Test public void testCount() { assertEquals(4, count(ranges)); }
@Test public void testCountRangeSet() { assertEquals(1, count(rangeSet.asRanges())); }