### Question:
SchematronCriteriaGroupSpecs { public static Specification<SchematronCriteriaGroup> hasSchematronId(final int schematronId) { return new Specification<SchematronCriteriaGroup>() { @Override public Predicate toPredicate(Root<SchematronCriteriaGroup> root, CriteriaQuery<?> query, CriteriaBuilder cb) { final Path<Integer> schematronIdPath = root.get(SchematronCriteriaGroup_.id).get(SchematronCriteriaGroupId_.schematronId); return cb.equal(schematronIdPath, schematronId); } }; }  static Specification<SchematronCriteriaGroup> hasSchematronId(final int schematronId); static Specification<SchematronCriteriaGroup> hasGroupName(final String name);  }### Answer:
@Test public void testHasSchematronId() throws Exception { SchematronCriteriaGroup group1 = newGroup(_inc, _schematronRepository); group1 = _criteriaGroupRepository.saveAndFlush(group1); SchematronCriteriaGroup group2 = newGroup(_inc, _schematronRepository); group2 = _criteriaGroupRepository.saveAndFlush(group2); SchematronCriteriaGroup group3 = newGroup(_inc, _schematronRepository); group3.setSchematron(group1.getSchematron()); group3 = _criteriaGroupRepository.saveAndFlush(group3); final List<SchematronCriteriaGroup> found = _criteriaGroupRepository.findAll(SchematronCriteriaGroupSpecs.hasSchematronId(group1.getSchematron() .getId())); assertCorrectCriteriaFound(group1, group2, group3, found); }