use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistRemoveObjectConcurrentModification.
@Test(expected = ConcurrentModificationException.class)
public void sublistRemoveObjectConcurrentModification() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
sequence.remove(0);
sublist.remove(sequence.get(2));
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistAddAllConcurrentModification.
@Test(expected = ConcurrentModificationException.class)
public void sublistAddAllConcurrentModification() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
sequence.remove(0);
sublist.addAll(Arrays.asList(SYSTEM.newInt(100), SYSTEM.newInt(101)));
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistRetainAllWithDuplicates.
@Test
public void sublistRetainAllWithDuplicates() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
final List<IonValue> toRetain = Arrays.asList(sublist.get(0), sublist.get(0));
assertTrue(sublist.retainAll(toRetain));
assertEquals(1, sublist.size());
assertTrue(sublist.contains(toRetain.get(0)));
assertEquals(5, sequence.size());
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistSubListConcurrentModification.
@Test(expected = ConcurrentModificationException.class)
public void sublistSubListConcurrentModification() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
sequence.remove(0);
sublist.subList(0, 1);
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistIsEmptyConcurrentModification.
@Test(expected = ConcurrentModificationException.class)
public void sublistIsEmptyConcurrentModification() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
sequence.remove(0);
sublist.isEmpty();
}
Aggregations