Token tok1 = new Token(jcas);
Token tok2 = new Token(jcas);
NonEmptyFSList fsList1 = new NonEmptyFSList(jcas);
fsList1.setHead(tok2);
fsList1.setTail(new EmptyFSList(jcas));
NonEmptyFSList fsList = new NonEmptyFSList(jcas);
fsList.setHead(tok1);
fsList.setTail(fsList1);
EmptyFSList emptyFsList = new EmptyFSList(jcas);
try {
emptyFsList.getNthElement(0);
assertTrue(false); // error if we get here
} catch (CASRuntimeException e) {
assertTrue(e.getMessageKey().equals(CASRuntimeException.JCAS_GET_NTH_ON_EMPTY_LIST));
System.out.print("Expected Error: ");
System.out.println(e.getMessage());