You can use a SortedSet with a given Ordering (which might be the name of the Class of the SocketOption? (if you want to avoid duplicates by type)