### Question:
CategoricalEvaluator extends Evaluator { public double accuracy() { if (hits + misses == 0) { return 0.0; } return hits / (double)(hits + misses); } CategoricalEvaluator();  CategoricalEvaluator(int... rawCategoryIndexes);  CategoricalEvaluator(String representative, int... rawCategoryIndexes);  CategoricalEvaluator(RepresentativeMetric representative, int... rawCategoryIndexes); void setCategoryIndexes(int... rawCategoryIndexes); @Override void compute(TrainingMap trainingMap); @Override void compute(TrainingMap trainingMap, StandardPredicate predicate); @Override double getRepresentativeMetric(); @Override boolean isHigherRepresentativeBetter(); double accuracy(); @Override String getAllStats(); static final String DELIM; static final String CONFIG_PREFIX; static final String CATEGORY_INDEXES_KEY; static final String DEFAULT_CATEGORY_INDEXES; static final String REPRESENTATIVE_KEY; static final String DEFAULT_REPRESENTATIVE; static final String DEFAULT_PREDICATE_KEY; }### Answer:
@Test public void testAccuracy() { CategoricalEvaluator computer = new CategoricalEvaluator(); computer.compute(trainingMap, predicate); assertEquals(1.0, computer.accuracy(), MathUtils.EPSILON); }