@Test
public void testBasicInterval() {

    InputInterval ii = new InputInterval(3,6);
    CycleSegment s1 = ii.getInputSegment(1);
    assertThat(s1).isNotNull();
    assertThat(s1.isExhausted()).isFalse();
    long v1 = s1.nextCycle();
    assertThat(v1).isEqualTo(3);
    CycleSegment s2 = ii.getInputSegment(2);
    assertThat(s2).isNotNull();
    assertThat(s2.isExhausted()).isFalse();
    long v2 = s2.nextCycle();
    assertThat(v2).isEqualTo(4);
    assertThat(s2.isExhausted()).isFalse();
    long v3 = s2.nextCycle();
    assertThat(v3).isEqualTo(5);
    assertThat(s2.isExhausted()).isTrue();
    long v4 = s2.nextCycle();
    assertThat(v4).isLessThan(0);
    assertThat(ii.getInputSegment(1)).isNull();
}