use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistAddWithIndexConcurrentModification.
@Test(expected = ConcurrentModificationException.class)
public void sublistAddWithIndexConcurrentModification() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
sequence.remove(0);
sublist.add(0, SYSTEM.newInt(0));
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistContainsConcurrentModification.
@Test(expected = ConcurrentModificationException.class)
public void sublistContainsConcurrentModification() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
final IonInt value = SYSTEM.newInt(99);
sequence.add(value);
sublist.contains(value);
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistToArrayConcurrentModification.
@Test(expected = ConcurrentModificationException.class)
public void sublistToArrayConcurrentModification() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
sequence.remove(0);
sublist.toArray();
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistAddAllWithIndexOutOfRange.
@Test(expected = IndexOutOfBoundsException.class)
public void sublistAddAllWithIndexOutOfRange() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
final List<IonInt> values = Arrays.asList(SYSTEM.newInt(100), SYSTEM.newInt(101));
sublist.addAll(3, values);
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistClearConcurrentModification.
@Test(expected = ConcurrentModificationException.class)
public void sublistClearConcurrentModification() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
sequence.retainAll(Collections.emptyList());
sublist.clear();
}
Aggregations