assertEquals(1, document.get(CoreAnnotations.SentencesAnnotation.class).size());
CoreMap sentence = document.get(CoreAnnotations.SentencesAnnotation.class).get(0);
Tree parse = sentence.get(TreeCoreAnnotations.TreeAnnotation.class);
assertEquals("(ROOT (S (NP (NNP John) (NNP Bauer)) (VP (VBZ works) (PP (IN at) (NP (NNP Stanford)))) (. .)))", parse.toString());
List<CoreLabel> tokens = sentence.get(CoreAnnotations.TokensAnnotation.class);
List<Label> leaves = parse.yield();
assertEquals(6, tokens.size());
assertEquals(6, leaves.size());
String[] expectedTags = {"NNP", "NNP", "VBZ", "IN", "NNP", "."};
for (int i = 0; i < tokens.size(); ++i) {
assertEquals(expectedTags[i], tokens.get(i).tag());