use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistAddWithIndexOutOfRange.
@Test(expected = IndexOutOfBoundsException.class)
public void sublistAddWithIndexOutOfRange() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
final IonInt value = SYSTEM.newInt(99);
sublist.add(4, value);
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistRemoveAll.
@Test
public void sublistRemoveAll() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
final List<IonValue> toRemove = Arrays.asList(sequence.get(2), sequence.get(3));
assertTrue(sublist.removeAll(toRemove));
assertEquals(1, sublist.size());
for (IonValue v : toRemove) {
assertFalse(sublist.contains(v));
}
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistRemoveIndexOutOfRange.
@Test(expected = IndexOutOfBoundsException.class)
public void sublistRemoveIndexOutOfRange() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
sublist.remove(3);
}
Aggregations