result.cachedTrimFragment = this;
if (!hasFragment()) { result.cachedTrimFragment = this; }
  public URI appendFragment(String fragment)  {    if (!validFragment(fragment))    {      throw new IllegalArgumentException(        "invalid fragment portion: " + fragment);    }    URI result = new URI(hierarchical, scheme, authority, device, absolutePath, segments, query, fragment);     result.cachedTrimFragment = this;    return result;  }