}
assertEquals(expected, count);
}
assertEquals("Number of documents is unexpected,", documentLengths.length - countZero(documentLengths), calculatedDocLengths.size());
long tokens = 0;
for(int docid : calculatedDocLengths.keys())
{
assertEquals("Document length for docid "+docid+" is unexpected,", documentLengths[docid], calculatedDocLengths.get(docid));
tokens += calculatedDocLengths.get(docid);
}
assertEquals("Number of tokens is unexpected,", StaTools.sum(documentLengths), tokens);