public VotingCombiner() {}
@Test
    public void votingCombinerTest() {
        Dataset<Label> pmd = pmdDataset();

        Model<Label> purpleModel = purpleTrainer.train(pmd);
        Model<Label> monkeyModel = monkeyTrainer.train(pmd);
        Model<Label> dishwasherModel = dishwasherTrainer.train(pmd);

        List<Model<Label>> modelList = new ArrayList<>();

        Example<Label> testExample = new ArrayExample<>(purple,new String[]{"X_0","X_1","X_2"}, new double[]{1,2,3});

        // Ties are broken with the first prediction
        modelList.add(purpleModel);
        modelList.add(monkeyModel);
        modelList.add(dishwasherModel);
        WeightedEnsembleModel<Label> ensemble = WeightedEnsembleModel.createEnsembleFromExistingModels("monkey",modelList,votingCombiner);
        assertEquals(3,ensemble.getNumModels());
        Prediction<Label> prediction = ensemble.predict(testExample);
        assertEquals(prediction.getOutput(),ensemble.getOutputIDInfo().getOutput(0));
        modelList.clear();

        // Combiner predicts the majority vote
        modelList.add(purpleModel);
        modelList.add(purpleModel);
        modelList.add(dishwasherModel);
        ensemble = WeightedEnsembleModel.createEnsembleFromExistingModels("purple",modelList,votingCombiner);
        assertEquals(3,ensemble.getNumModels());
        prediction = ensemble.predict(testExample);
        assertEquals(prediction.getOutput(),purple);
        modelList.clear();

        // Weights affect the vote
        modelList.add(purpleModel);
        modelList.add(monkeyModel);
        modelList.add(dishwasherModel);
        ensemble = WeightedEnsembleModel.createEnsembleFromExistingModels("dishwasher",modelList,votingCombiner,new float[]{1,1,3});
        assertEquals(3,ensemble.getNumModels());
        prediction = ensemble.predict(testExample);
        assertEquals(prediction.getOutput(),dishwasher);
        modelList.clear();

        Helpers.testModelSerialization(ensemble,Label.class);
    }