@Test
public void testCumeDistWithRepeatValues() throws Exception {

    Over func = new Over();
    DataBag inbag = BagFactory.getInstance().newDefaultBag();
    Random r = new Random();
    Tuple t = TupleFactory.getInstance().newTuple(2);
    t.set(0, null);
    t.set(1, r.nextInt(100));
    inbag.add(t);
    t = TupleFactory.getInstance().newTuple(2);
    t.set(0, null);
    t.set(1, r.nextInt(100));
    inbag.add(t);
    t = TupleFactory.getInstance().newTuple(2);
    t.set(0, 2);
    t.set(1, r.nextInt(100));
    inbag.add(t);
    t = TupleFactory.getInstance().newTuple(2);
    t.set(0, 5);
    t.set(1, r.nextInt(100));
    inbag.add(t);
    t = TupleFactory.getInstance().newTuple(2);
    t.set(0, 5);
    t.set(1, r.nextInt(100));
    inbag.add(t);
    t = TupleFactory.getInstance().newTuple(2);
    t.set(0, 5);
    t.set(1, r.nextInt(100));
    inbag.add(t);
    t = TupleFactory.getInstance().newTuple(2);
    t.set(0, 7);
    t.set(1, r.nextInt(100));
    inbag.add(t);
    t = TupleFactory.getInstance().newTuple(5);
    t.set(0, inbag);
    t.set(1, "cume_dist");
    t.set(2, -1);
    t.set(3, -1);
    t.set(4, 0);
    DataBag outbag = func.exec(t);
    assertEquals(7, outbag.size());
    int count = 1;
    for (Tuple to : outbag) {
        assertEquals(1, to.size());
        assertEquals(count/7.0, to.get(0));
        count++;
    }
    /*
    Iterator<Tuple> iter = outbag.iterator();
    t = iter.next();
    assertEquals(0.14285714285714285, t.get(0));
    t = iter.next();
    assertEquals(0.14285714285714285, t.get(0));
    t = iter.next();
    assertEquals(0.42857142857142855, t.get(0));
    t = iter.next();
    assertEquals(0.5714285714285714, t.get(0));
    t = iter.next();
    assertEquals(0.5714285714285714, t.get(0));
    t = iter.next();
    assertEquals(0.5714285714285714, t.get(0));
    t = iter.next();
    assertEquals(1.0, t.get(0));
    */
}