public <T> CompletableFuture<Response.Success<T>>
	call(final Resource<? extends T> resource) {
		final CompletableFuture<HttpResponse<ServerResponse<T>>> response =
			client.sendAsync(
				toRequest(resource),
				new ServerBodyHandler<T>(reader, resource.type())
			);

		return response
			.thenCompose(result ->
				switch (result.body().toResponse(resource, result)) {
					case Response.Success<T> success -> completedFuture(success);
					case Response.Failure<T> failure -> {
						final var exception = new ResponseException(failure);
						yield failedFuture(exception);
					}
				}
			)
			.exceptionallyCompose(throwable -> {
				final var error = new Response.ClientError<>(
					resource,
					switch (throwable) {
						case UncheckedIOException e -> e.getCause();
						case Throwable e -> e;
					}
				);
				final var exception = new ResponseException(error);
				return failedFuture(exception);
			});
	}
Calls the given {@code resource} and returns its result.

@param resource the resource to call
@return the call response
@param <T> the response body type
@throws NullPointerException if the given {@code resource} is {@code null}
jenetics.incubator/src/main/java/io/jenetics/incubator/restful/client/DefaultClient.java