@Test
public void testSimple() {

  List<GenericItemSimilarity.ItemItemSimilarity> similarities = Lists.newArrayList();
  similarities.add(new GenericItemSimilarity.ItemItemSimilarity(1, 2, 0.5));
  similarities.add(new GenericItemSimilarity.ItemItemSimilarity(2, 1, 0.6));
  similarities.add(new GenericItemSimilarity.ItemItemSimilarity(1, 1, 0.5));
  similarities.add(new GenericItemSimilarity.ItemItemSimilarity(1, 3, 0.3));
  GenericItemSimilarity itemCorrelation = new GenericItemSimilarity(similarities);
  assertEquals(1.0, itemCorrelation.itemSimilarity(1, 1), EPSILON);
  assertEquals(0.6, itemCorrelation.itemSimilarity(1, 2), EPSILON);
  assertEquals(0.6, itemCorrelation.itemSimilarity(2, 1), EPSILON);
  assertEquals(0.3, itemCorrelation.itemSimilarity(1, 3), EPSILON);
  assertTrue(Double.isNaN(itemCorrelation.itemSimilarity(3, 4)));
}