### Question:
JsonRpcHttpService { public CompletableFuture<?> start() { LOG.info("Starting JSON-RPC service on {}:{}", config.getHost(), config.getPort()); final CompletableFuture<?> resultFuture = new CompletableFuture<>(); try { httpServer = vertx.createHttpServer(getHttpServerOptions()); httpServer .requestHandler(buildRouter()) .listen( res -> { if (!res.failed()) { resultFuture.complete(null); config.setPort(httpServer.actualPort()); LOG.info( "JSON-RPC service started and listening on {}:{}{}", config.getHost(), config.getPort(), tlsLogMessage()); natService.ifNatEnvironment( NatMethod.UPNP, natManager -> ((UpnpNatManager) natManager) .requestPortForward( config.getPort(), NetworkProtocol.TCP, NatServiceType.JSON_RPC)); return; } httpServer = null; resultFuture.completeExceptionally(getFailureException(res.cause())); }); } catch (final JsonRpcServiceException tlsException) { httpServer = null; resultFuture.completeExceptionally(tlsException); } catch (final VertxException listenException) { httpServer = null; resultFuture.completeExceptionally( new JsonRpcServiceException( String.format( "Ethereum JSON-RPC listener failed to start: %s", ExceptionUtils.rootCause(listenException).getMessage()))); } return resultFuture; } JsonRpcHttpService(
      final Vertx vertx,
      final Path dataDir,
      final JsonRpcConfiguration config,
      final MetricsSystem metricsSystem,
      final NatService natService,
      final Map<String, JsonRpcMethod> methods,
      final HealthService livenessService,
      final HealthService readinessService); private  JsonRpcHttpService(
      final Vertx vertx,
      final Path dataDir,
      final JsonRpcConfiguration config,
      final MetricsSystem metricsSystem,
      final NatService natService,
      final Map<String, JsonRpcMethod> methods,
      final Optional<AuthenticationService> authenticationService,
      final HealthService livenessService,
      final HealthService readinessService); CompletableFuture<?> start(); CompletableFuture<?> stop(); InetSocketAddress socketAddress(); @VisibleForTesting String url(); @VisibleForTesting final Optional<AuthenticationService> authenticationService; }### Answer:
@Test public void invalidCallToStart() { service .start() .whenComplete( (unused, exception) -> assertThat(exception).isInstanceOf(IllegalStateException.class)); }