Map<String, Set<String>> runExamples(File examplesDir, boolean verbose) {
    Map<String, Set<String>> map = new TreeMap<String, Set<String>>();
    for (Example e : getExamples(examplesDir)) {
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter(sw);
      e.run(pw, true, verbose);
      pw.close();
      String[] lines = sw.toString().split("\n");
      for (String line : lines) {
        if (!line.startsWith("compiler.")) continue;
        int colon = line.indexOf(":");
        if (colon == -1) continue;
        String key = line.substring(0, colon);
        StringBuilder sb = new StringBuilder();
        sb.append("# ");
        int i = 0;
        String[] descs = line.substring(colon + 1).split(", *");
        for (String desc : descs) {
          if (i > 0) sb.append(", ");
          sb.append(i++);
          sb.append(": ");
          sb.append(desc.trim());
        }
        Set<String> set = map.get(key);
        if (set == null) map.put(key, set = new TreeSet<String>());
        set.add(sb.toString());
      }
    }

    return map;
  }
 public static void main(String... args) {
   try {
     Example clientExample = new RealDeviceExample(System.out, args);
     clientExample.run();
   } catch (HiveException | ExampleException | IOException e) {
     System.err.println(e.getMessage());
   }
 }
 @Test
 public void testAdvancedMigScheduling() {
   Example ex = new AdvancedMigScheduling();
   ex.run();
 }
 @Test
 public void testNetworkAndMigrations() {
   Example ex = new NetworkAndMigrations();
   ex.run();
 }
 @Test
 public void testDecommissioning() {
   Example ex = new Decommissionning();
   ex.run();
 }
 @Test
 public void testModelCustomization() {
   Example ex = new ModelCustomization();
   ex.run();
 }
 @Test
 public void testSolvingTuning() {
   Example ex = new SolverTuning();
   ex.run();
 }
 @Test
 public void testGettingStarted() {
   Example ex = new GettingStarted();
   ex.run();
 }