@Test
 public void removeIntervalsAndCacheDoesNothingWhenOtherIntervalsIsEmpty() {
   CompoundInterval ci = createCompoundIntervalWithoutRegister();
   ci.add(new MappedBasicInterval(DEFAULT_END + 1, DEFAULT_END + 2, null));
   ci.add(new MappedBasicInterval(DEFAULT_END + 2, DEFAULT_END + 3, null));
   CompoundInterval cached = ci.removeIntervalsAndCache(new CompoundInterval(null));
   assertThat(ci.size(), is(3));
   assertThat(cached.isEmpty(), is(true));
 }
 @Test
 public void removeIntervalsAndCacheWorksWhenOtherIntervalIsASubset() {
   CompoundInterval ci = createCompoundIntervalWithoutRegister();
   ci.add(new MappedBasicInterval(DEFAULT_END + 1, DEFAULT_END + 2, null));
   ci.add(new MappedBasicInterval(DEFAULT_END + 2, DEFAULT_END + 3, null));
   ci.add(new MappedBasicInterval(DEFAULT_END + 1, DEFAULT_END + 4, null));
   ci.add(new MappedBasicInterval(DEFAULT_BEGIN, DEFAULT_END + 1, null));
   CompoundInterval toRemove = new CompoundInterval(DEFAULT_END + 1, DEFAULT_END + 2, null);
   toRemove.add(new MappedBasicInterval(DEFAULT_BEGIN, DEFAULT_END, null));
   CompoundInterval cached = ci.removeIntervalsAndCache(toRemove);
   assertThat(cached.size(), is(2));
   assertThat(
       cached.contains(new MappedBasicInterval(DEFAULT_BEGIN, DEFAULT_END, null)), is(true));
   assertThat(
       cached.contains(new MappedBasicInterval(DEFAULT_END + 1, DEFAULT_END + 2, null)), is(true));
   assertThat(ci.size(), is(3));
   assertThat(
       ci.contains(new MappedBasicInterval(DEFAULT_BEGIN, DEFAULT_END + 1, null)), is(true));
   assertThat(
       ci.contains(new MappedBasicInterval(DEFAULT_END + 1, DEFAULT_END + 4, null)), is(true));
   assertThat(
       ci.contains(new MappedBasicInterval(DEFAULT_END + 2, DEFAULT_END + 3, null)), is(true));
 }