code: public void awaitResponses(long timeout, TimeUnit unit) {
          Iterator<Entry<Integer, Entry<ChannelFuture, ChannelPromise>>> itr = streamidPromiseMap.entrySet().iterator();
          while (itr.hasNext()) {
              Entry<Integer, Entry<ChannelFuture, ChannelPromise>> entry = itr.next();
              ChannelFuture writeFuture = entry.getValue().getKey();
              if (!writeFuture.awaitUninterruptibly(timeout, unit)) {
                  throw new IllegalStateException("Timed out waiting to write for stream id " + entry.getKey());
              }
              if (!writeFuture.isSuccess()) {
                  throw new RuntimeException(writeFuture.cause());
              }
              ChannelPromise promise = entry.getValue().getValue();
              if (!promise.awaitUninterruptibly(timeout, unit)) {
                  throw new IllegalStateException("Timed out waiting for response on stream id " + entry.getKey());
              }
              if (!promise.isSuccess()) {
                  throw new RuntimeException(promise.cause());
              }
              System.out.println("---Stream id: " + entry.getKey() + " received---");
              itr.remove();
          }
      }
docs: Wait (sequentially) for a time duration for each anticipated response
  
  @param timeout Value of time to wait for each response
  @param unit Units associated with {@code timeout}
  @see HttpResponseHandler#put(int, io.netty.channel.ChannelFuture, io.netty.channel.ChannelPromise)