assertEquals(3, postings2.getDf());
assertEquals(8, postings2.getCf());
Posting posting = new Posting();
PostingsReader reader = postings2.getPostingsReader();
int arr[] = null;
reader.nextPosting(posting);
arr = reader.getPositions();
assertEquals(13, posting.getDocno());
assertEquals(5, posting.getScore());
assertEquals(1, arr[0]);
assertEquals(4, arr[1]);
assertEquals(5, arr[2]);
assertEquals(10, arr[3]);
assertEquals(23, arr[4]);
reader.nextPosting(posting);
arr = reader.getPositions();
assertEquals(14, posting.getDocno());
assertEquals(2, posting.getScore());
assertEquals(2, arr[0]);
assertEquals(23, arr[1]);
reader.nextPosting(posting);
arr = reader.getPositions();
assertEquals(24, posting.getDocno());
assertEquals(1, posting.getScore());
assertEquals(1, arr[0]);
// Set new tf and cf.
postings2.setDf(6);
postings2.setCf(16);
// Verify tf and cf.
assertEquals(6, postings2.getDf());
assertEquals(16, postings2.getCf());
reader = postings2.getPostingsReader();
arr = null;
reader.nextPosting(posting);
arr = reader.getPositions();
assertEquals(13, posting.getDocno());
assertEquals(5, posting.getScore());
assertEquals(1, arr[0]);
assertEquals(4, arr[1]);
assertEquals(5, arr[2]);
assertEquals(10, arr[3]);
assertEquals(23, arr[4]);
reader.nextPosting(posting);
arr = reader.getPositions();
assertEquals(14, posting.getDocno());
assertEquals(2, posting.getScore());
assertEquals(2, arr[0]);
assertEquals(23, arr[1]);
reader.nextPosting(posting);
arr = reader.getPositions();
assertEquals(24, posting.getDocno());
assertEquals(1, posting.getScore());
assertEquals(1, arr[0]);
PostingsListDocSortedPositional postings3 =
PostingsListDocSortedPositional.create(postings2.serialize());
postings3.setCollectionDocumentCount(20);
// Verify tf and cf.
assertEquals(6, postings2.getDf());
assertEquals(16, postings2.getCf());
reader = postings2.getPostingsReader();
arr = null;
reader.nextPosting(posting);
arr = reader.getPositions();
assertEquals(13, posting.getDocno());
assertEquals(5, posting.getScore());
assertEquals(1, arr[0]);
assertEquals(4, arr[1]);
assertEquals(5, arr[2]);
assertEquals(10, arr[3]);
assertEquals(23, arr[4]);
reader.nextPosting(posting);
arr = reader.getPositions();
assertEquals(14, posting.getDocno());
assertEquals(2, posting.getScore());
assertEquals(2, arr[0]);
assertEquals(23, arr[1]);
reader.nextPosting(posting);
arr = reader.getPositions();
assertEquals(24, posting.getDocno());
assertEquals(1, posting.getScore());
assertEquals(1, arr[0]);
}