RangeHelper { public boolean isRangeValid(final Range range) { return (range.getFrom() > -1 && range.getTo() >= range.getFrom()); }  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 shouldBeValid() { assertThat(rangeHelper.isRangeValid(new Range(0, 0)), is(true)); assertThat(rangeHelper.isRangeValid(new Range(10, 20)), is(true)); assertThat(rangeHelper.isRangeValid(new Range(10, 10)), is(true)); }
@Test public void shouldNotBeValid() { assertThat(rangeHelper.isRangeValid(new Range(10, 6)), is(false)); assertThat(rangeHelper.isRangeValid(new Range(-1, 6)), is(false)); }