code: public JSONObject nodesMapToJSON(StaticRouting.NodesMap nm) {
          JSONObject o = new JSONObject();
          o.put("src", nm.getSrc().id());
          o.put("dst", nm.getDst().id());
          return o;
      }
docs: Convert a nodes map (a pair of two distinguishable nodes => source and destination) into a JSON object
  
  @param nm the nodes map to convert
  @return the nodes map JSON object