code: public static Optional<Tag> parse(final String httpTag) {
          Tag result = null;
          boolean weak = false;
          String internal = httpTag;
  
          if (internal.startsWith("W/")) {
              weak = true;
              internal = internal.substring(2);
          }
  
          if (internal.startsWith("\"") && internal.endsWith("\"")) {
              result = new Tag(
                      internal.substring(1, internal.length() - 1), weak);
          }
          else if (internal.equals("*")) {
              result = new Tag("*", weak);
          }
  
          return Optional.ofNullable(result);
      }
docs: Parses a tag formatted as defined by the HTTP standard.
  
  @param httpTag The HTTP tag string; if it starts with 'W/' the tag will be
  marked as weak and the data following the 'W/' used as the tag;
  otherwise it should be surrounded with quotes (e.g.,
  "sometag").
  
  @return A new tag instance.
  
  @see <a
  href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11">HTTP
  Entity Tags</a>