public static void main(String[] args) throws Exception {
   Peer master = null;
   try {
     Peer[] peers = ExampleUtils.createAndAttachNodes(100, 4001);
     master = peers[0];
     MyPeer myPeer = new MyPeer(master);
     ExampleUtils.bootstrap(peers);
     myPeer
         .put(
             "This is my location key",
             "This is my domain",
             "This is my content key",
             "And here comes the data")
         .awaitUninterruptibly();
     FutureDHT futureDHT =
         myPeer.get("This is my location key", "This is my domain", "This is my content key");
     futureDHT.awaitUninterruptibly();
     System.err.println(futureDHT.getFailedReason());
     Map<Number160, Data> map = futureDHT.getDataMap();
     for (Data data : map.values()) {
       MyData myData = (MyData) data.getObject();
       System.out.println(
           "key: "
               + myData.getKey()
               + ", domain: "
               + myData.getDomain()
               + ", content: "
               + myData.getContent()
               + ", data: "
               + myData.getData());
     }
   } finally {
     master.halt();
   }
 }
  /**
   * Entry point of the demo application.
   *
   * @param args command line arguments
   */
  public static void main(String[] args) {
    // Starts the sampler
    Sampler sampler = new Sampler();
    sampler.setDaemon(true);
    sampler.start();

    // Starts the measuring
    while (true) {
      try (Split ignored = SimonManager.getStopwatch("sampled-stopwatch").start()) {
        ExampleUtils.waitRandomlySquared(50);
      }
    }
  }