### Question:
DataMajorityNerRecommender extends RecommendationEngine { @Override public void train(RecommenderContext aContext, List<CAS> aCasses) throws RecommendationException { List<Annotation> annotations = extractAnnotations(aCasses); DataMajorityModel model = trainModel(annotations); aContext.put(KEY_MODEL, model); } DataMajorityNerRecommender(Recommender aRecommender); @Override RecommendationEngineCapability getTrainingCapability(); @Override void train(RecommenderContext aContext, List<CAS> aCasses); @Override boolean isReadyForPrediction(RecommenderContext aContext); @Override void predict(RecommenderContext aContext, CAS aCas); @Override EvaluationResult evaluate(List<CAS> aCasses, DataSplitter aDataSplitter); static final Key<DataMajorityModel> KEY_MODEL; }### Answer:
@Test public void thatTrainingWorks() throws Exception { DataMajorityNerRecommender sut = new DataMajorityNerRecommender(recommender); List<CAS> casList = loadDevelopmentData(); sut.train(context, casList); assertThat(context.get(DataMajorityNerRecommender.KEY_MODEL)) .as("Model has been set") .isNotNull(); }