code: public HString trimRight(@NonNull Predicate<? super Annotation> toTrimPredicate) {
        int end = tokenLength() - 1;
        while (end >= 0 && toTrimPredicate.test(tokenAt(end))) {
           end--;
        }
        if (end > 0) {
           return tokenAt(0).union(tokenAt(end));
        } else if (end == 0) {
           return tokenAt(0);
        }
        return Fragments.empty(document());
     }
docs: Trims tokens off the right of this HString that match the given predicate.
  
  @param toTrimPredicate the predicate to use to determine if a token should be removed (evaulate to TRUE) or kept
  (evaluate to FALSE).
  @return the trimmed HString