add test for getMaxTermId.