code: public T orElseThrow(final String msg) {
          checkNonEmptyString(msg, "Valid message required");
          if (isPresent()) {
              return get();
          }
  
          throw new NoSuchElementException(msg);
      }
docs: If optional is not empty return it's value, if empty throw a NoSuchElementException with message.
  
  @param msg message for exception
  @return optional value if present
  @throws java.util.NoSuchElementException thrown if optional is empty
  @since 1.7.3