question: public static Peer createMapPeer ( Map map ) throws MessageException { if ( ! map . containsKey ( PORT ) || ! map . containsKey ( ADDRESS ) ) throw new MessageException ( "Invalid address map" ) ; int port = ( int ) ( long ) map . get ( PORT ) ; String address = ( String ) map . get ( ADDRESS ) ; String peerId = null ; if ( map . containsKey ( PEER_ID ) ) peerId = ( String ) map . get ( PEER_ID ) ; return new Peer ( peerId , new InetSocketAddress ( address , port ) ) ; }
target:  Create a peer from a map.