Tokenizers { public static Tokenizer pattern(Pattern pattern) { return new Split(pattern); } private  Tokenizers(); static Tokenizer pattern(Pattern pattern); static Tokenizer pattern(String regex); static Tokenizer qGram(int q); static Tokenizer qGramWithFilter(int q); static Tokenizer qGramWithPadding(int q); static Tokenizer qGramWithPadding(int q, String padding); static Tokenizer qGramWithPadding(int q, String startPadding,
			String endPadding); static Tokenizer whitespace(); static Tokenizer transform(Tokenizer tokenizer,
			Function<String, String> function); static Tokenizer chain(List<Tokenizer> tokenizers); static Tokenizer chain(Tokenizer tokenizer, Tokenizer... tokenizers); static Tokenizer filter(Tokenizer tokenizer,
			Predicate<String> predicate);  }
@Test public void shouldReturnSplitForPattern() { Tokenizer tokenizer = Tokenizers.pattern(pattern); assertEquals(Split.class, tokenizer.getClass()); Split split = (Split) tokenizer; assertEquals(pattern, split.getPattern()); }
@Test public void shouldReturnSplitForRegex() { Tokenizer tokenizer = Tokenizers.pattern(regex); assertEquals(Split.class, tokenizer.getClass()); Split split = (Split) tokenizer; assertEquals(regex, split.getPattern().toString()); }