public static InetSocketAddress getInetSocketAddressFromRpcURL(String rpcURL) throws Exception {
        // Pekko URLs have the form schema://systemName@host:port/.... if it's a remote Pekko URL
        try {
            final Address address = getAddressFromRpcURL(rpcURL);

            if (address.host().isDefined() && address.port().isDefined()) {
                return new InetSocketAddress(address.host().get(), (int) address.port().get());
            } else {
                throw new MalformedURLException();
            }
        } catch (MalformedURLException e) {
            throw new Exception("Could not retrieve InetSocketAddress from Pekko URL " + rpcURL);
        }
    }
@Test
    void getHostFromRpcURLThrowsExceptionIfAddressCannotBeRetrieved() throws Exception {
        final String localRpcURL = "pekko://flink/user/actor";

        assertThatThrownBy(() -> PekkoUtils.getInetSocketAddressFromRpcURL(localRpcURL))
                .isInstanceOf(Exception.class);
    }