class RestGrantEndpoint implements GrantEndpoint {

    @Override
    public ServiceResult<Void> send(Grant grant) {

        List<Grant> grantAsList = singletonList(grant);

        Either<ResponseEntity<Void>, ResponseEntity<JsonNode>> response =
                adaptor.restPostWithEntity(silRestServiceUrl + path, grantAsList,
                        JsonNode.class, Void.class, HttpStatus.OK, HttpStatus.ACCEPTED);

        return response.mapLeftOrRight(
                failure -> {
                    LOG.debug("Sent grant FAILURE : " + toJson(grant));
                    return serviceFailure(new Error(GRANT_PROCESS_SEND_FAILED, failure.getStatusCode()));
                },
                success -> {
                    LOG.debug("Sent grant SUCCESS : " + toJson(grant));
                    return serviceSuccess();
                }
        );
    }

}