@Test
public void matchAsCharSequence() {

  CharSequence match = first(" >= ").in("foo >= bar").get();
  assertThat(match.length()).isEqualTo(4);
  assertThat(match.charAt(0)).isEqualTo(' ');
  assertThat(match.charAt(1)).isEqualTo('>');
  assertThat(match.charAt(2)).isEqualTo('=');
  assertThat(match.charAt(3)).isEqualTo(' ');
  assertThat(match.toString()).isEqualTo(" >= ");
  assertThrows(IndexOutOfBoundsException.class, () -> match.charAt(-1));
  assertThrows(IndexOutOfBoundsException.class, () -> match.charAt(4));
  assertThrows(IndexOutOfBoundsException.class, () -> match.charAt(Integer.MAX_VALUE));
  assertThrows(IndexOutOfBoundsException.class, () -> match.charAt(Integer.MIN_VALUE));
  assertThrows(IndexOutOfBoundsException.class, () -> match.subSequence(-1, 1));
  assertThrows(IndexOutOfBoundsException.class, () -> match.subSequence(5, 5));
  assertThrows(IndexOutOfBoundsException.class, () -> match.subSequence(0, 5));
}