@Test
public void testSortingSimpleNumberTuple()
{

  SortedMovingWindow<Integer, Null> smw = new SortedMovingWindow<Integer, Null>();
  CollectorTestSink<Object> testSink = new CollectorTestSink<Object>();
  smw.outputPort.setSink(testSink);
  smw.setup(null);
  smw.setWindowSize(2);
  // The incoming 6 integer tuples are disordered among 4 windows
  emitObjects(smw, new Integer[][]{{1,3}, {2,5}, {4}, {6}});
  smw.beginWindow(4);
  smw.endWindow();
  smw.beginWindow(5);
  smw.endWindow();
  // The outcome is sorted
  Assert.assertEquals(Lists.newArrayList(1, 2, 3, 4, 5, 6), testSink.collectedTuples);
}