PigContext pigContext = new PigContext(ExecType.LOCAL, new Properties());
log.info("Running Store...");
String storeFile = File.createTempFile("pig-tmp", "").getAbsolutePath();
PigFile store = new PigFile(storeFile);
store.store(bag, new BinStorage(), pigContext);
log.info("Done.");
log.info("Running Load...");
PigFile load = new PigFile(storeFile);
DataBag loaded = load.load(new BinStorage(), pigContext);
log.info("Done.");
assertTrue(bag.size() == loaded.size());
Iterator<Tuple> it1 = bag.iterator();