text: public static List<TransportProtocol> getTransportProtocols() {int cnt = protocols.size();List<TransportProtocol> res = new ArrayList<>(cnt);for (WeakReference<TransportProtocol> ref : protocols) {TransportProtocol proto = ref.get();if (proto != null)res.add(proto);elseprotocols.remove(ref);}return Collections.unmodifiableList(res);}