AveragingPreferenceInferrer implements PreferenceInferrer { @Override public float inferPreference(long userID, long itemID) throws TasteException { return averagePreferenceValue.get(userID); } AveragingPreferenceInferrer(DataModel dataModel); @Override float inferPreference(long userID, long itemID); @Override void refresh(Collection<Refreshable> alreadyRefreshed); @Override String toString();  }
@Test public void testInferrer() throws TasteException { DataModel model = getDataModel(new long[] {1}, new Double[][] {{3.0,-2.0,5.0}}); PreferenceInferrer inferrer = new AveragingPreferenceInferrer(model); double inferred = inferrer.inferPreference(1, 3); assertEquals(2.0, inferred, EPSILON); }