public InetSocketAddress getManagedPort(
        final UdpChannel udpChannel,
        final InetSocketAddress bindAddress) throws BindException
    {
        InetSocketAddress address = bindAddress;

        if (bindAddress.getPort() != 0)
        {
            portSet.add(bindAddress.getPort());
        }
        else if (!isOsWildcard)
        {
            // do not map if not a subscription and does not have a control address. We want to use an ephemeral port
            // for the control channel on publications.
            if (!isSender || udpChannel.hasExplicitControl())
            {
                address = new InetSocketAddress(bindAddress.getAddress(), allocateOpenPort());
            }
        }

        return address;
    }
@Test
    void shouldPassThroughWithExplicitBindAddressInsideRange() throws BindException
    {
        final InetSocketAddress bindAddress = new InetSocketAddress("localhost", 20003);
        final WildcardPortManager manager = new WildcardPortManager(portRange, true);

        assertThat(manager.getManagedPort(
            udpChannelPort0, bindAddress), is(new InetSocketAddress("localhost", 20003)));
    }