token1.addToIndexes();
// index1 is a sorted index, so when adding a token twice, both remain in the index
Token token2 = new Token(jcas, 3, 4);
token2.addToIndexes();
token2.addToIndexes();
Sentence sentence1 = new Sentence(jcas, 1, 2);
sentence1.addToIndexes();
// index2 is a set index, so even when adding a sentence twice, only one remains in the index