### Question:
Ruta { public static void applyRule(JCas jcas, String rule, Object... configurationData) throws ResourceInitializationException, AnalysisEngineProcessException { AnalysisEngine ae = null; if (configurationData == null || configurationData.length == 0) { ae = AnalysisEngineFactory.createEngine(RutaEngine.class, RutaEngine.PARAM_RULES, rule); } else { Object[] config = ArrayUtils.addAll(configurationData, RutaEngine.PARAM_RULES, rule); ae = AnalysisEngineFactory.createEngine(RutaEngine.class, config); } ae.process(jcas); ae.destroy(); }  static void applyRule(JCas jcas, String rule, Object... configurationData); static void apply(CAS cas, String script, Map<String, Object> parameters); static void apply(CAS cas, String script); static void removeDebugInformation(JCas jcas); static String inject(String script, String placeholder, int[] addresses); static String inject(String script, FeatureStructureImpl... annotations); static List<Annotation> select(JCas jcas, String rule, Object... configurationData); static boolean matches(JCas jcas, String rule, Object... configurationData); static AnalysisEngine wrapAnalysisEngine(URL descriptorUrl, String viewName,
          ResourceManager resourceManager); static AnalysisEngine wrapAnalysisEngine(URL descriptorUrl, String viewName,
          boolean rutaEngine, String encoding, ResourceManager resourceManager); @Deprecated static AnalysisEngineDescription createAnalysisEngineDescription(String script); @Deprecated static AnalysisEngineDescription createAnalysisEngineDescription(String script,
          TypeSystemDescription... tsds);  }### Answer:
@Test public void testApplyRule() throws Exception { CAS cas = RutaTestUtils.getCAS("Some document."); JCas jcas = cas.getJCas(); Ruta.applyRule(jcas, "CW{-> MARK(T1)} SW;"); RutaTestUtils.assertAnnotationsEquals(cas, 1, 1, "Some"); Ruta.applyRule(jcas, "T1 SW{-> MARK(T2)};"); RutaTestUtils.assertAnnotationsEquals(cas, 2, 1, "document"); Ruta.applyRule(jcas, "T1{-> MARK(T3,1,2,3)} T2 PERIOD;"); RutaTestUtils.assertAnnotationsEquals(cas, 3, 1, "Some document."); }