}
public void testCtorCharSequenceIntIntIntExceptions() {
// beginIndex and endIndex in range, pos outside to the left
try {
it = new CharSequenceCharacterIterator(seq, 0, 5, -1);
fail();
} catch (IllegalArgumentException e) {
}
try {
it = new CharSequenceCharacterIterator(seq, 3, 5, 2);
fail();
} catch (IllegalArgumentException e) {
}
// beginIndex and endIndex in range, pos outside to the right
try {
it = new CharSequenceCharacterIterator(seq, 0, 3, 4);
fail();
} catch (IllegalArgumentException e) {
}
try {
it = new CharSequenceCharacterIterator(seq, 3, 5, 2345346);
fail();
} catch (IllegalArgumentException e) {
}
// beginIndex larger than endIndex
try {
it = new CharSequenceCharacterIterator(seq, 5, 3, 4);
fail();
} catch (IllegalArgumentException e) {
}
try {
it = new CharSequenceCharacterIterator(seq, 5, 2, 1);
fail();
} catch (IllegalArgumentException e) {
}
try {
it = new CharSequenceCharacterIterator(seq, 3, 1, 5);
fail();
} catch (IllegalArgumentException e) {
assertTrue(true);
}
// beginIndex outside of the sequence to the left
try {
it = new CharSequenceCharacterIterator(seq, -1, 2, 0);
fail();
} catch (IllegalArgumentException e) {
}
// beginIndex outside of the sequence to the right
try {
it = new CharSequenceCharacterIterator(seq, 100, 105, 102);
fail();
} catch (IllegalArgumentException e) {
}
// endIndex outside of the sequence to the left
try {
it = new CharSequenceCharacterIterator(seq, -7, -3, -5);
fail();
} catch (IllegalArgumentException e) {
}
// endIndex outside of the sequence to the right
try {
it = new CharSequenceCharacterIterator(seq, 3, 100, 4);
fail();
} catch (IllegalArgumentException e) {
}
}