code: public static Prefer valueOf(final String value) {
          if (value != null) {
              final Map<String, String> data = new HashMap<>();
              final Set<String> params = new HashSet<>();
              stream(value.split(";")).map(String::trim).map(pref -> pref.split("=", 2)).forEach(x -> {
                  if (x.length == 2) {
                      data.put(x[0].trim(), x[1].trim());
                  } else {
                      params.add(x[0].trim());
                  }
              });
              return new Prefer(data.get(PREFER_RETURN), parseParameter(data.get(PREFER_INCLUDE)),
                          parseParameter(data.get(PREFER_OMIT)), params, data.get(PREFER_HANDLING));
          }
          return null;
      }
docs: Create a Prefer header representation from a header string.
  
  @param value the header value
  @return a Prefer object or null on an invalid string