### Question:
AggregateBuilder { public AggregateBuilder() { this(null, null, null); } AggregateBuilder();  AggregateBuilder(TypeSystemDescription typeSystemDescription,
          TypePriorities typePriorities, FlowControllerDescription flowControllerDescription); String add(AnalysisEngineDescription aed, String... viewNames); void add(String componentName, AnalysisEngineDescription aed, String... viewNames); void addSofaMapping(String componentName, String componentViewName,
          String aggregateViewName); void setFlowControllerDescription(FlowControllerDescription flowControllerDescription); AnalysisEngine createAggregate(); AnalysisEngineDescription createAggregateDescription();  }### Answer:
@Test public void testAggregateBuilder() throws UIMAException, IOException { tokenBuilder.buildTokens(jCas, "Anyone up for a game of Foosball?"); AggregateBuilder builder = new AggregateBuilder(); builder.add(AnalysisEngineFactory.createEngineDescription(Annotator1.class, typeSystemDescription), ViewNames.PARENTHESES_VIEW, "A"); builder.add(AnalysisEngineFactory.createEngineDescription(Annotator2.class, typeSystemDescription), ViewNames.SORTED_VIEW, "B", ViewNames.SORTED_PARENTHESES_VIEW, "C", ViewNames.PARENTHESES_VIEW, "A"); builder.add(AnalysisEngineFactory.createEngineDescription(Annotator3.class, typeSystemDescription), ViewNames.INITIAL_VIEW, "B"); AnalysisEngine aggregateEngine = builder.createAggregate(); aggregateEngine.process(jCas); assertEquals("Anyone up for a game of Foosball?", jCas.getDocumentText()); assertEquals("Any(o)n(e) (u)p f(o)r (a) g(a)m(e) (o)f F(oo)sb(a)ll?", jCas.getView("A") .getDocumentText()); assertEquals("?AFaaabeeffgllmnnoooooprsuy", jCas.getView("B").getDocumentText()); assertEquals("(((((((((())))))))))?AFaaabeeffgllmnnoooooprsuy", jCas.getView("C") .getDocumentText()); assertEquals("yusrpooooonnmllgffeebaaaFA?", jCas.getView(ViewNames.REVERSE_VIEW) .getDocumentText()); CasIOUtil.readJCas(jCas, new File("src/test/resources/data/docs/test.xmi")); AnalysisEngine ae1 = AnalysisEngineFactory.createEngine(NoOpAnnotator.class, typeSystemDescription); SimplePipeline.runPipeline(jCas, ae1, aggregateEngine); AnalysisEngineDescription aggregateDescription = builder.createAggregateDescription(); builder = new AggregateBuilder(); builder.add(aggregateDescription); builder.add(AnalysisEngineFactory.createEngineDescription(Annotator1.class, typeSystemDescription), ViewNames.PARENTHESES_VIEW, "PARENS"); aggregateEngine = builder.createAggregate(); jCas.reset(); tokenBuilder.buildTokens(jCas, "Anyone up for a game of Foosball?"); aggregateEngine.process(jCas); assertEquals("Anyone up for a game of Foosball?", jCas.getDocumentText()); assertEquals("Any(o)n(e) (u)p f(o)r (a) g(a)m(e) (o)f F(oo)sb(a)ll?", jCas.getView("A") .getDocumentText()); assertEquals("?AFaaabeeffgllmnnoooooprsuy", jCas.getView("B").getDocumentText()); assertEquals("(((((((((())))))))))?AFaaabeeffgllmnnoooooprsuy", jCas.getView("C") .getDocumentText()); assertEquals("yusrpooooonnmllgffeebaaaFA?", jCas.getView(ViewNames.REVERSE_VIEW) .getDocumentText()); assertEquals("Any(o)n(e) (u)p f(o)r (a) g(a)m(e) (o)f F(oo)sb(a)ll?", jCas.getView("PARENS") .getDocumentText()); }