@Test
public void testMajorityReturnedWhenAttributesToExamineIsEmpty()
throws Exception {
// tests RecursionBaseCase#2
DataSet ds = DataSetFactory.getRestaurantDataSet();
DecisionTreeLearner learner = new DecisionTreeLearner();
DataSet ds2 = ds.emptyDataSet();
// 3 examples have classification = "yes" and one ,"no"
ds2.add(ds.getExample(0));
ds2.add(ds.getExample(1));// "no"
ds2.add(ds.getExample(2));
ds2.add(ds.getExample(3));
ds2.setSpecification(new MockDataSetSpecification("will_wait"));
learner.train(ds2);
Assert.assertEquals("Yes", learner.predict(ds.getExample(1)));
}