static String getPortNumber(PeerNode p) { if (p == null || p.getPeer() == null) return "null"; return Integer.toString(p.getPeer().getPort()); }