code: public static String optimizerPlanAsJSON(Plan plan) throws Exception {
  		LocalExecutor exec = new LocalExecutor();
  		try {
  			exec.start();
  			PactCompiler pc = new PactCompiler(new DataStatistics());
  			OptimizedPlan op = pc.compile(plan);
  			PlanJSONDumpGenerator gen = new PlanJSONDumpGenerator();
  
  			return gen.getOptimizerPlanAsJSON(op);
  		} finally {
  			exec.stop();
  		}
  	}
docs: Returns a JSON dump of the optimized plan.
  
  @param plan
  The program's plan.
  @return JSON dump of the optimized plan.
  @throws Exception