List<PhysicalOperator> inputs = new LinkedList<PhysicalOperator>();
inputs.add(lr1);
inputs.add(lr2);
POCogroup poc = new POCogroup(new OperatorKey("", r.nextLong()), -1,
inputs);
List<Tuple> expected = new LinkedList<Tuple>();
Tuple t1 = TupleFactory.getInstance().newTuple();
t1.append(1);
DataBag b1 = BagFactory.getInstance().newDefaultBag();
Tuple temp = TupleFactory.getInstance().newTuple();
temp.append(1);
b1.add(temp);
b1.add(temp);
t1.append(b1);
DataBag b2 = BagFactory.getInstance().newDefaultBag();
b2.add(temp);
t1.append(b2);
expected.add(t1);
t1 = TupleFactory.getInstance().newTuple();
t1.append(2);
DataBag b3 = BagFactory.getInstance().newDefaultBag();
temp = TupleFactory.getInstance().newTuple();
temp.append(2);
b3.add(temp);
t1.append(b3);
DataBag b4 = BagFactory.getInstance().newDefaultBag();
b4.add(temp);
b4.add(temp);
t1.append(b4);
expected.add(t1);
// System.out.println(expected.get(0) + " " + expected.get(1));
List<Tuple> obtained = new LinkedList<Tuple>();
for (Result res = poc.getNext(t); res.returnStatus != POStatus.STATUS_EOP; res = poc
.getNext(t)) {
System.out.println(res.result);
obtained.add((Tuple) res.result);
assertTrue(expected.contains((Tuple) res.result));
}