use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistIsEmpty.
@Test
public void sublistIsEmpty() {
IonSequence sequence = newSequence();
assertTrue(sequence.subList(0, 0).isEmpty());
assertFalse(sequence.subList(0, 1).isEmpty());
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistContainsAllConcurrentModification.
@Test(expected = ConcurrentModificationException.class)
public void sublistContainsAllConcurrentModification() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
final IonValue value = sequence.remove(0);
sublist.containsAll(Collections.singletonList(value));
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistAddSame.
@Test(expected = ContainedValueException.class)
public void sublistAddSame() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
final IonValue value = sequence.get(0);
sublist.add(value);
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistLastIndexOfConcurrentModification.
@Test(expected = ConcurrentModificationException.class)
public void sublistLastIndexOfConcurrentModification() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
sequence.remove(0);
sublist.lastIndexOf(sequence.get(2));
}
use of com.amazon.ion.IonSequence in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistRemoveIndex.
@Test
public void sublistRemoveIndex() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
final IonInt ionValue = (IonInt) sublist.remove(0);
assertEquals(2, sublist.size());
assertEquals(2, ionValue.intValue());
}
Aggregations