@SuppressWarnings("unchecked")
@Test
public void testBagOfAnnotationMerge() throws IOException {
TupleFactory tf = TupleFactory.getInstance();
DefaultDataBag textBag = new DefaultDataBag();
DefaultDataBag beginBag = new DefaultDataBag();
DefaultDataBag endBag = new DefaultDataBag();
DefaultDataBag typeBag = new DefaultDataBag();
textBag.add(tf.newTupleNoCopy(Arrays.asList(JOHN_SENTENCE)));
beginBag.add(tf.newTupleNoCopy(Arrays.asList(0)));
endBag.add(tf.newTupleNoCopy(Arrays.asList(10)));
typeBag.add(tf.newTupleNoCopy(Arrays.asList("person")));
textBag.add(tf.newTupleNoCopy(Arrays.asList(JOHN_SENTENCE)));
beginBag.add(tf.newTupleNoCopy(Arrays.asList(19)));
endBag.add(tf.newTupleNoCopy(Arrays.asList(36)));
typeBag.add(tf.newTupleNoCopy(Arrays.asList("organization")));
// all bags
Tuple input = tf.newTupleNoCopy(Arrays.asList(textBag, beginBag,
endBag, typeBag));
String merged = merger.exec(input);