RangeHelper { public long getRangeLength(final Range range) { return range.getTo() - range.getFrom() + 1; }  long getRangeLength(final Range range); boolean isRangeValid(final Range range); long getTotalLength(final List<Range> ranges); boolean isSatisfiable(final Iterable<Range> ranges, final long streamLength);  }
@Test public void shouldComputeLength() { assertThat(rangeHelper.getRangeLength(new Range(0, 0)), is(1L)); assertThat(rangeHelper.getRangeLength(new Range(0, 10)), is(11L)); assertThat(rangeHelper.getRangeLength(new Range(2, 3)), is(2L)); assertThat(rangeHelper.getRangeLength(new Range(11, 12)), is(2L)); }