@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));
}