code: @Override
      public void handle(String chargingStationId, JsonObject commandObject, IdentityContext identityContext) throws UserIdentityUnauthorizedException {
          ChargingStationId csId = new ChargingStationId(chargingStationId);
  
          if (!commandAuthorizationService.isAuthorized(csId, identityContext.getUserIdentity(), RequestCancelReservationCommand.class)) {
              throw new UserIdentityUnauthorizedException(chargingStationId, identityContext.getUserIdentity(), RequestCancelReservationCommand.class);
          }
  
          try {
              ChargingStation chargingStation = repository.findOne(chargingStationId);
              if (chargingStation != null && chargingStation.communicationAllowed()) {
  
                  ReservationId reservationId = new StringReservationId(commandObject.get("reservationId").getAsString());
  
                  commandGateway.send(new RequestCancelReservationCommand(csId, reservationId, identityContext), new CorrelationToken());
              } else {
                  throw new IllegalStateException("It is not possible to cancel a reservation on a charging station that is not registered");
              }
          } catch (JsonSyntaxException ex) {
              throw new IllegalArgumentException("Cancel reservation command is not able to parse the payload, is your json correctly formatted?", ex);
          }
      }
docs: {@inheritDoc}