@VisibleForTesting
    public static ActorSystem startRemoteActorSystem(
            Configuration configuration,
            String externalAddress,
            String externalPortRange,
            Logger logger)
            throws Exception {
        return startRemoteActorSystem(
                configuration,
                PekkoUtils.getFlinkActorSystemName(),
                externalAddress,
                externalPortRange,
                NetUtils.getWildcardIPAddress(),
                Optional.empty(),
                logger,
                PekkoUtils.getForkJoinExecutorConfig(
                        getForkJoinExecutorConfiguration(configuration)),
                null);
    }
@Test
    void testActorSystemInstantiationFailureWhenPortOccupied() throws Exception {
        final ServerSocket portOccupier = new ServerSocket(0, 10, InetAddress.getByName("0.0.0.0"));

        try {
            final int port = portOccupier.getLocalPort();
            assertThatThrownBy(
                            () ->
                                    ActorSystemBootstrapTools.startRemoteActorSystem(
                                            new Configuration(),
                                            "0.0.0.0",
                                            String.valueOf(port),
                                            LOG))
                    .satisfies(FlinkAssertions.anyCauseMatches(BindException.class));
        } finally {
            portOccupier.close();
        }
    }