@Test
public void testSetRange() throws IOException {

  // Mess with the stream range multiple times
  stream.setRange(1, 3);
  Assert.assertEquals(1, stream.read());
  Assert.assertEquals(2, stream.read());
  Assert.assertEquals(3, stream.read());
  Assert.assertEquals(-1, stream.read());
  stream.setRange(99, 2);
  Assert.assertEquals(99, stream.read());
  Assert.assertEquals(100, stream.read());
  Assert.assertEquals(-1, stream.read());
}