import org.junit.Test;
public class TestToBagToTuple {
@Test
public void toBag() throws Exception{
ToBag tb = new ToBag();
Tuple input = TupleFactory.getInstance().newTuple();
for (int i = 0; i < 100; ++i) {
input.append(i);
}
Set<Integer> s = new HashSet<Integer>();
DataBag db = tb.exec(input);
for (Tuple t : db) {
s.add((Integer) t.get(0));
}
// finally check the bag had everything we put in the tuple.