randomUUID = UUID.randomUUID();
b.addItem( randomUUID.toString());
randomUUID = UUID.randomUUID();
c.addItem( randomUUID.toString());
}
SetSimilarityUDF simUDF = new SetSimilarityUDF();
double same = simUDF.evaluate(a.getMinHashItems(), a.getMinHashItems());
System.out.println( "Similarity with self = " + same);
Assert.assertEquals( 1.0, same, 0);
double diff = simUDF.evaluate(a.getMinHashItems(), b.getMinHashItems());
System.out.println( "Similarity with different = " + diff);
Assert.assertEquals( 0, diff , 0.03); /// Might not be quite zero
a.combine(c);
b.combine(c);
double mixed = simUDF.evaluate( a.getMinHashItems(), b.getMinHashItems());
System.out.println("Similarity with mixed = " +mixed);
//// Should be about a third
Assert.assertEquals( 0.333333333, mixed, 0.03);
}