#vulnerable code 
                                public static void main(String ... args) throws InterruptedException, ExecutionException, TimeoutException {
        RpcServer server = createServer();
        server.start();

        RpcClient client = createClient();

        Request request = Request.newBuilder()
                .withContentType("text/plain")
                .withBody("Johnny".getBytes(Charset.forName("UTF-8")))
                .withCorrelationId(UUID.randomUUID().toString())
                .build();

        CompletableFuture<Response> future = client.call(request);

        Response response = future.get(20, TimeUnit.SECONDS);
        System.out.println("Responded -> " + new String(response.getBody()));

        client.shutdown();
        server.shutdown();

        System.exit(0);
    } 
                            #location 22 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public static void main(String ... args) throws InterruptedException, ExecutionException, TimeoutException {
        RequestHandler handler = request -> {
            String reqStr = new String(request.getBody());
            return Response.newBuilder()
                    .withBody(("Hello " + reqStr).getBytes())
                    .withContentType("text/plain")
                    .withLast(request.isSingleReplyExpected())
                    .withCorrelationId(request.getCorrelationId())
                    .buildSuccess();
        };

        RpcServer server = createServer(handler);
        server.start();

        RpcClient client = createClient();

        Request request = Request.newBuilder()
                .withContentType("text/plain")
                .withBody("Johnny".getBytes(Charset.forName("UTF-8")))
                .withCorrelationId(UUID.randomUUID().toString())
                .build();

        CompletableFuture<Response> future = new CompletableFuture<>();
        client.call(request, future::complete);

        Response response = future.get(20, TimeUnit.SECONDS);
        System.out.println("Responded -> " + new String(response.getBody()));

        client.shutdown();
        server.shutdown();

        System.exit(0);
    }