code: public List<HString> charNGrams(int minOrder, int maxOrder) {
        Preconditions.checkArgument(minOrder <= maxOrder,
                                    "minimum ngram order must be less than or equal to the maximum ngram order");
        Preconditions.checkArgument(minOrder > 0, "minimum ngram order must be greater than 0.");
        List<HString> ngrams = new ArrayList<>();
        for (int i = 0; i < length(); i++) {
           for (int j = i + minOrder; j <= length() && j <= i + maxOrder; j++) {
              ngrams.add(substring(i, j));
           }
        }
        return ngrams;
     }
docs: Extracts all character n-grams from the given minimum to given maximum order (e.g. 1=unigram, 2=bigram, etc.)
  
  @param minOrder the minimum order
  @param maxOrder the maximum order
  @return the list of character n-grams of order <code>minOrder</code> to <code>maxOrder</code> making up this
  HString
  @throws IllegalArgumentException If minOrder > maxOrder or minOrder <= 0