}
}
POProject prj = new POProject(new OperatorKey("", r.nextLong()), -1, 0);
prj.setResultType(DataType.LONG);
PONegative pn = new PONegative(new OperatorKey("", r.nextLong()), -1, prj);
pn.setResultType(DataType.LONG);
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) {
Long output = (Long)pn.getNextLong().result;
assertNull(output);
} else {
Long expected = -(Long)t.get(0);
long output = (Long) pn.getNextLong().result;
assertEquals(expected.longValue(), output);
}
}
}