@Override
    public Iterator<Text> search(String term) {
        if (invertedFile.containsKey(term)) {
            ArrayList<Text> hits = new ArrayList<>(invertedFile.get(term));
            return hits.iterator();
        } else {
            return Collections.emptyIterator();
        }
    }
@Test
    public void testSearchNoHits() {
        System.out.println("search 'no hits'");
        String[] terms = {"thisisnotaword"};
        Iterator<Relevance> hits = corpus.search(new BM25(), terms);
        assertFalse(hits.hasNext());
    }