text: public static IList<TransportProtocol> GetTransportProtocols(){int cnt = protocols.Count;IList<TransportProtocol> res = new AList<TransportProtocol>(cnt);foreach (JavaWeakReference<TransportProtocol> @ref in protocols){TransportProtocol proto = @ref.Get();if (proto != null){res.AddItem(proto);}else{protocols.Remove(@ref);}}return Sharpen.Collections.UnmodifiableList(res);}