add test and javadoc for CriteriaService