CAS srcCas = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(), indexes);
CAS srcCasView = srcCas.createView("TestView");
srcCasView.setDocumentText("This is a test");
CAS destCas = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(), indexes);
LowLevelCAS lowLevelSrcCasView = srcCasView.getLowLevelCAS();
int typeCode = lowLevelSrcCasView.ll_getTypeSystem().ll_getCodeForType(
srcCas.getAnnotationType());
int destFsAddr = lowLevelSrcCasView.ll_createFS(typeCode);
AnnotationFS fs = (AnnotationFS) lowLevelSrcCasView.ll_getFSForRef(destFsAddr);
fs.setIntValue(srcCas.getBeginFeature(), 0);
fs.setIntValue(srcCas.getEndFeature(), 4);