@Test
public void termFrequency(){

	List<String> textTokens = Arrays.asList("x", "x", "x", "x");
	List<String> termTokens;
	assertEquals(0, termFrequency(textTokens, Arrays.asList("x", "x", "x", "x", "x"), true, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, Arrays.asList("x", "x", "x", "x"), true, 0, false, Integer.MAX_VALUE));
	assertEquals(2, termFrequency(textTokens, Arrays.asList("x", "x", "x"), true, 0, false, Integer.MAX_VALUE));
	assertEquals(3, termFrequency(textTokens, Arrays.asList("x", "x"), true, 0, false, Integer.MAX_VALUE));
	assertEquals(4, termFrequency(textTokens, Arrays.asList("x"), true, 0, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("x", "X", "x", "x");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, true, 1, false, 1));
	assertEquals(1, termFrequency(textTokens, termTokens, true, 1, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("x", "Y", "x", "x");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(0, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, true, 1, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("x", "X", "x");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(2, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, true, 1, false, 1));
	assertEquals(2, termFrequency(textTokens, termTokens, true, 1, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("x", "X");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(3, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, true, 1, false, 1));
	assertEquals(3, termFrequency(textTokens, termTokens, true, 1, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("X");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(4, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, true, 1, false, 1));
	assertEquals(4, termFrequency(textTokens, termTokens, true, 1, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("x", "X", "X", "x");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(0, termFrequency(textTokens, termTokens, true, 1, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, true, 2, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("x", "Y", "Y", "x");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(0, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, true, 2, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("x", "X", "X");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(2, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(0, termFrequency(textTokens, termTokens, true, 1, false, Integer.MAX_VALUE));
	assertEquals(2, termFrequency(textTokens, termTokens, true, 2, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("X", "X");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(3, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(0, termFrequency(textTokens, termTokens, true, 1, false, Integer.MAX_VALUE));
	assertEquals(3, termFrequency(textTokens, termTokens, true, 2, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("x", "X", "X", "X");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(0, termFrequency(textTokens, termTokens, true, 1, false, Integer.MAX_VALUE));
	assertEquals(0, termFrequency(textTokens, termTokens, true, 2, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, true, 3, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("x", "Y", "Y", "Y");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(0, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, true, 3, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("X", "X", "X");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(2, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(0, termFrequency(textTokens, termTokens, true, 1, false, Integer.MAX_VALUE));
	assertEquals(0, termFrequency(textTokens, termTokens, true, 2, false, Integer.MAX_VALUE));
	assertEquals(2, termFrequency(textTokens, termTokens, true, 3, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("X", "X", "X", "X");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	termTokens = Arrays.asList("Y", "Y", "Y", "Y");
	assertEquals(0, termFrequency(textTokens, termTokens, true, 0, false, Integer.MAX_VALUE));
	assertEquals(0, termFrequency(textTokens, termTokens, false, 0, false, Integer.MAX_VALUE));
	assertEquals(1, termFrequency(textTokens, termTokens, true, 4, false, Integer.MAX_VALUE));
}