Alignments { public static List<Long> ends(final Iterable<Range<Long>> ranges) { List<Long> ends = new ArrayList<Long>(); for (Range<Long> range : ranges) { checkClosedOpen(range); ends.add(range.upperEndpoint()); } return ends; } 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 testEndsNull() { ends(null); }
@Test public void testEndsEmpty() { assertEquals(Collections.emptyList(), ends(Collections.<Range<Long>>emptySet())); }
@Test(expected=NullPointerException.class) public void testEndsNullRange() { ends(Collections.singleton((Range<Long>) null)); }
@Test(expected=IllegalArgumentException.class) public void testEndsOpen() { ends(Collections.singleton(Range.open(2L, 4L))); }
@Test(expected=IllegalArgumentException.class) public void testEndsClosed() { ends(Collections.singleton(Range.closed(2L, 4L))); }
@Test(expected=IllegalArgumentException.class) public void testEndsSingleton() { ends(Collections.singleton(Range.singleton(2L))); }
@Test public void testEnds() { List<Long> ends = ends(ranges); assertEquals(4, ends.size()); assertEquals(Long.valueOf(0L), ends.get(0)); assertEquals(Long.valueOf(1L), ends.get(1)); assertEquals(Long.valueOf(43L), ends.get(2)); assertEquals(Long.valueOf(43L), ends.get(3)); }
@Test public void testEndsRangeSet() { List<Long> ends = ends(rangeSet.asRanges()); assertEquals(1, ends.size()); assertEquals(Long.valueOf(43L), ends.get(0)); }