use of com.amazon.ion.IonValue in project ion-java by amzn.
the class BaseIonSequenceLiteSublistTestCase method sublistLastIndexOf.
@Test
public void sublistLastIndexOf() {
final IonSequence sequence = newSequence();
final List<IonValue> sublist = sequence.subList(2, 5);
assertEquals(0, sublist.lastIndexOf(sequence.get(2)));
assertEquals(-1, sublist.lastIndexOf(sequence.get(0)));
assertEquals(-1, sublist.lastIndexOf(SYSTEM.newInt(99)));
}
use of com.amazon.ion.IonValue 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.IonValue 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.IonValue 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.IonValue 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