@Test
public void testWeightedMean()
{

  ModeOperator<Double> oper = new ModeOperator<Double>();
  CollectorTestSink<Double> sink = new CollectorTestSink<Double>();
  TestUtils.setSink(oper.mode, sink);
  oper.setup(null);
  oper.beginWindow(0);
  oper.data.process(1.0);
  oper.data.process(7.0);
  oper.data.process(3.0);
  oper.data.process(9.0);
  oper.data.process(7.0);
  oper.data.process(7.0);
  oper.endWindow();
  Assert.assertEquals("Must be one tuple in sink", sink.collectedTuples.size(), 1);
  Assert.assertTrue("Median value", sink.collectedTuples.get(0) == 7.0);
}