Alignments { public static List<Long> starts(final Iterable<Range<Long>> ranges) { List<Long> starts = new ArrayList<Long>(); for (Range<Long> range : ranges) { checkClosedOpen(range); starts.add(range.lowerEndpoint()); } return starts; } 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 testStartsNull() { starts(null); }
@Test public void testStartsEmpty() { assertEquals(Collections.emptyList(), starts(Collections.<Range<Long>>emptySet())); }
@Test(expected=NullPointerException.class) public void testStartsNullRange() { starts(Collections.singleton((Range<Long>) null)); }
@Test(expected=IllegalArgumentException.class) public void testStartsOpen() { starts(Collections.singleton(Range.open(2L, 4L))); }
@Test(expected=IllegalArgumentException.class) public void testStartsClosed() { starts(Collections.singleton(Range.closed(2L, 4L))); }
@Test(expected=IllegalArgumentException.class) public void testStartsSingleton() { starts(Collections.singleton(Range.singleton(2L))); }
@Test public void testStarts() { List<Long> starts = starts(ranges); assertEquals(4, starts.size()); assertEquals(Long.valueOf(0L), starts.get(0)); assertEquals(Long.valueOf(0L), starts.get(1)); assertEquals(Long.valueOf(0L), starts.get(2)); assertEquals(Long.valueOf(1L), starts.get(3)); }
@Test public void testStartsRangeSet() { List<Long> starts = starts(rangeSet.asRanges()); assertEquals(1, starts.size()); assertEquals(Long.valueOf(0L), starts.get(0)); }