### Question:
Tokenizer { public static List<String> computeStartingWordNGrams(String string, int n1, int n2) { ArrayList<String> ngrams = new ArrayList<>(); String[] split = string.split(" "); n2 = Math.min(n2, split.length); for (int i = 0; i < Math.min(split.length, n2 - n1 + 1); i++) { String ngram = ""; for (int j = 0; j < n2 - i; j++) { ngram += split[j] + " "; } ngram = ngram.trim(); if (!ngram.isEmpty()) { ngrams.add(ngram); } } return ngrams; } private  Tokenizer(); static List<String> tokenize(String inputString); static Set<String> calculateCharNGrams(String string, int n); static Set<String> calculateAllCharEdgeNGrams(String string, int n1, int n2); static Set<String> calculateAllCharEdgeNGrams(String string, int n1, int n2, boolean mustHitLeftEdge); static Set<String> calculateCharEdgeNGrams(String string, int n, boolean mustHitLeftEdge); static Set<String> calculateWordNGrams(String string, int n); static List<String> calculateWordNGramsAsList(String string, int n); static Set<String> calculateAllCharNGrams(String string, int n1, int n2); static Set<String> calculateAllWordNGrams(String string, int n1, int n2); static Set<List<String>> computeSplits(String string, int n1, int n2, int maxSplits); static List<String> computeStartingWordNGrams(String string, int n1, int n2); static String getSentence(String string, int position); static List<String> getSentences(String inputText, boolean onlyRealSentences); static List<String> getSentences(String inputText, boolean onlyRealSentences, Language language); static List<String> getSentences(String inputText); static List<String> getSentences(String inputText, Language language); static String getPhraseFromBeginningOfSentence(String inputString); static String getPhraseToEndOfSentence(String string); static void main(String[] args); static final String TOKEN_SPLIT_REGEX; static final String SENTENCE_SPLIT_REGEX_EN; static final String SENTENCE_SPLIT_REGEX_DE; }### Answer:
@Test public void testComputeStartingWordNGrams() { collector.checkThat(Tokenizer.computeStartingWordNGrams("This is a test.", 1, 3), hasItem("This")); collector.checkThat(Tokenizer.computeStartingWordNGrams("This is a test.", 1, 3), hasItem("This is")); collector.checkThat(Tokenizer.computeStartingWordNGrams("This is a test.", 1, 3), hasItem("This is a")); collector.checkThat(Tokenizer.computeStartingWordNGrams("This is a test.", 1, 3).size(), is(3)); collector.checkThat(Tokenizer.computeStartingWordNGrams("my broccoli rabe “spaghetti,” tomato & chicken", 1, 3).size(), is(3)); }