public void testThresholds() throws Exception {
Map<String, Integer> thresholds = new HashMap<String, Integer>();
thresholds.put("test", 3);
//IndexReader in = IndexReader.open(sourceDir, true);
IndexReader in = IndexReader.open(sourceDir);
TFTermPruningPolicy tfp = new TFTermPruningPolicy(in, null, thresholds, 2);
PruningReader tfr = new PruningReader(in, null, tfp);
assertTDCount(tfr, new Term("test", "one"), 0);
assertTDCount(tfr, new Term("test", "two"), 0);
assertTD(tfr, new Term("test", "three"), new int[]{4});
assertTDCount(tfr, new Term("test", "four"), 0);