SimpleFeatureVectorSimilarity implements Similarity { @Override public double computeScore(Collection<TermId> query, Collection<TermId> target) { return Sets.intersection(Sets.newHashSet(query), Sets.newHashSet(target)).size(); }  @Override String getName(); @Override String getParameters(); @Override boolean isSymmetric(); @Override double computeScore(Collection<TermId> query, Collection<TermId> target);  }
@Test public void testComputeSimilarities() { assertEquals( 1.0, similarity.computeScore( Lists.newArrayList( TermId.of("HP:0000008"), TermId.of("HP:0000009")), Lists.newArrayList(TermId.of("HP:0000008"))), 0.01); assertEquals( 1.0, similarity.computeScore( Lists.newArrayList( TermId.of("HP:0000008"), TermId.of("HP:0000009")), Lists.newArrayList( TermId.of("HP:0000008"), TermId.of("HP:0000010"))), 0.01); assertEquals( 0.0, similarity.computeScore( Lists.newArrayList(TermId.of("HP:0000009")), Lists.newArrayList( TermId.of("HP:0000008"), TermId.of("HP:0000010"))), 0.01); }