code: public Optional<Slot> getSlot(String slotName) {
           Map<String, Slot> slots = castRequestType(handlerInput, IntentRequest.class).getIntent().getSlots();
           if (slots != null) {
               return Optional.ofNullable(slots.get(slotName));
           }
           return Optional.empty();
      }
docs: Returns the {@link Slot} for the given slot name from the request.
  
  This method attempts to retrieve the requested {@link Slot} from the incoming request. If the slot does not
  exist in the request, an {@link Optional} empty is returned.
  
  This method returns an {@link IllegalArgumentException} if the incoming request is not an {@link IntentRequest}.
  
  @param slotName name of the slot to retrieve
  @return an {@link Optional} containing the target slot if it exists in the request, else an empty {@link Optional}