code: public Object getFirst(String name) {
      Object value = get(name);
      if (value instanceof Collection<?>) {
        @SuppressWarnings("unchecked")
        Collection<Object> collectionValue = (Collection<Object>) value;
        Iterator<Object> iterator = collectionValue.iterator();
        return iterator.hasNext() ? iterator.next() : null;
      }
      return value;
    }
docs: Returns the first query parameter value for the given query parameter name.
  
  @param name query parameter name
  @return first query parameter value