@Test
public void testToUserVectorReducer() throws Exception {
Reducer<VarLongWritable,VarLongWritable,VarLongWritable,VectorWritable>.Context context =
EasyMock.createMock(Reducer.Context.class);
context.write(EasyMock.eq(new VarLongWritable(12L)), MathHelper.vectorMatches(
MathHelper.elem(TasteHadoopUtils.idToIndex(34L), 1.0), MathHelper.elem(TasteHadoopUtils.idToIndex(56L), 2.0)));
EasyMock.replay(context);
List<VarLongWritable> varLongWritables = new LinkedList<VarLongWritable>();
varLongWritables.add(new EntityPrefWritable(34L, 1.0f));
varLongWritables.add(new EntityPrefWritable(56L, 2.0f));
new ToUserVectorReducer().reduce(new VarLongWritable(12L), varLongWritables, context);
EasyMock.verify(context);
}