### Question:
JaccardSimilarity implements Similarity { @Override public double computeScore(Collection<TermId> query, Collection<TermId> target) { final Set<TermId> termIdsQuery = ontology.getAllAncestorTermIds(query, false); final Set<TermId> termIdsTarget = ontology.getAllAncestorTermIds(target, false); double intersectionSize = Sets.intersection(termIdsQuery, termIdsTarget).size(); if (normalized) { return intersectionSize / Sets.union(termIdsQuery, termIdsTarget).size(); } else { return intersectionSize; } } JaccardSimilarity(Ontology ontology);  JaccardSimilarity(Ontology ontology, boolean normalized); @Override String getName(); @Override String getParameters(); @Override boolean isSymmetric(); @Override double computeScore(Collection<TermId> query, Collection<TermId> target);  }### Answer:
@Test void testComputeSimilarities() { assertEquals( 0.25, similarity.computeScore(Lists.newArrayList(idBeet), Lists.newArrayList(idCarrot)), 0.01); assertEquals( 0.66, similarity.computeScore(Lists.newArrayList(idBlueCarrot), Lists.newArrayList(idCarrot)), 0.01); assertEquals( 0.33, similarity.computeScore(Lists.newArrayList(idPumpkin), Lists.newArrayList(idCarrot)), 0.01); assertEquals( 0.0, similarity.computeScore(Lists.newArrayList(idLeafVegetable), Lists.newArrayList(idCarrot)), 0.01); }