protected int selfTest(InstanceStream testStream) {
        int returnStatus = 1;
        Instance testInst = null;
        int maxInstances = this.maxInstancesOption.getValue();
        long instancesProcessed = 0;
        //InstanceStream testStream = (InstanceStream) getPreparedClassOption(this.testStreamOption);
        ClassificationPerformanceEvaluator evaluator = new BasicClassificationPerformanceEvaluator();
        evaluator.reset();

        while (testStream.hasMoreInstances()
                && ((maxInstances < 0) || (instancesProcessed < maxInstances))) {
            testInst = (Instance) testStream.nextInstance().copy();
            int trueClass = (int) testInst.classValue();
            testInst.setClassMissing();
            double[] prediction = model.getVotesForInstance(testInst);
            evaluator.addClassificationAttempt(trueClass, prediction, testInst
                    .weight());
            instancesProcessed++;
            if (instancesProcessed % INSTANCES_BETWEEN_MONITOR_UPDATES == 0) {

                long estimatedRemainingInstances = testStream
                        .estimatedRemainingInstances();
                if (maxInstances > 0) {
                    long maxRemaining = maxInstances - instancesProcessed;
                    if ((estimatedRemainingInstances < 0)
                            || (maxRemaining < estimatedRemainingInstances)) {
                        estimatedRemainingInstances = maxRemaining;
                    }
                }
                System.out.println(estimatedRemainingInstances < 0 ? -1.0
                                : (double) instancesProcessed
                                / (double) (instancesProcessed + estimatedRemainingInstances));

            }
        }
        return returnStatus;
    }