}
}
POProject prj = new POProject(new OperatorKey("", r.nextLong()), -1, 0);
prj.setResultType(DataType.INTEGER);
PONegative pn = new PONegative(new OperatorKey("", r.nextLong()), -1, prj);
pn.setResultType(DataType.INTEGER);
PhysicalPlan plan = new PhysicalPlan();
plan.add(prj); plan.add(pn);
plan.connect(prj, pn);
for(Iterator<Tuple> it = bag.iterator(); it.hasNext(); ) {
Tuple t = it.next();
plan.attachInput(t);
if(t.get(0) == null) {
Integer output = (Integer)pn.getNext((Integer)null).result;
assertEquals(null, output);
} else {
Integer expected = -(Integer)t.get(0);
int output = (Integer) pn.getNext(expected).result;
assertEquals(expected.intValue(), output);
}
}
}