Because the mybatis cache the result set, but no cache lookup total page size, so the second taken from a cache when unable to obtain the total number of pages
org.mybatis.pagination.helpers.StringHelper.likeValue(String value) throw exception while running MapperTest
My JDK version is 1.7.0_45.And I found that: it was the bug caused by the constant variableLIKE_FORMATE, It was %%s%, I changed it to %%%s%%, then the tests passed all right.