@Test
public void termFrequencyTable(){

	List<String> textTokens = Arrays.asList("a", "b", "A", "c");
	Set<List<String>> termTokenSet = new HashSet<List<String>>(){
		{
			add(Arrays.asList("a"));
			add(Arrays.asList("a", "b"));
			add(Arrays.asList("a", "b", "c"));
		}
	};
	Map<List<String>, Integer> expectedTermFrequencyTable = new HashMap<>();
	expectedTermFrequencyTable.put(Arrays.asList("a"), 2);
	Map<List<String>, Integer> termFrequencyTable = TextUtil.termFrequencyTable(textTokens, termTokenSet, false, 0, 1);
	assertEquals(expectedTermFrequencyTable, termFrequencyTable);
	expectedTermFrequencyTable.put(Arrays.asList("a", "b"), 1);
	termFrequencyTable = TextUtil.termFrequencyTable(textTokens, termTokenSet, false, 0, 2);
	assertEquals(expectedTermFrequencyTable, termFrequencyTable);
	expectedTermFrequencyTable = new HashMap<>();
	expectedTermFrequencyTable.put(Arrays.asList("a"), 4);
	termFrequencyTable = TextUtil.termFrequencyTable(textTokens, termTokenSet, false, 1, 1);
	assertEquals(expectedTermFrequencyTable, termFrequencyTable);
	termFrequencyTable = TextUtil.termFrequencyTable(textTokens, termTokenSet, true, 1, 1);
	assertEquals(expectedTermFrequencyTable, termFrequencyTable);
	expectedTermFrequencyTable.put(Arrays.asList("a", "b"), 2);
	termFrequencyTable = TextUtil.termFrequencyTable(textTokens, termTokenSet, false, 1, 2);
	assertEquals(expectedTermFrequencyTable, termFrequencyTable);
	expectedTermFrequencyTable.put(Arrays.asList("a", "b"), 1);
	termFrequencyTable = TextUtil.termFrequencyTable(textTokens, termTokenSet, true, 1, 2);
	assertEquals(expectedTermFrequencyTable, termFrequencyTable);
}