SchematronValidator extends AbstractSchematronValidator { public List<ApplicableSchematron> getApplicableSchematronList(final int metadataId, final Element md, final MetadataSchema metadataSchema) { List<ApplicableSchematron> applicableSchematron = Lists.newArrayList(); SchematronRepository schematronRepository = ApplicationContextHolder.get().getBean(SchematronRepository.class); final List<Schematron> schematronList = schematronRepository.findAllBySchemaName(metadataSchema.getName()); Collections.sort(schematronList, Schematron.DISPLAY_PRIORITY_COMPARATOR); for (Schematron schematron : schematronList) { final ApplicableSchematron applicable = getApplicableSchematron(metadataId, md, metadataSchema, schematron); if (applicable.requirement != SchematronRequirement.DISABLED) { if (Log.isDebugEnabled(Geonet.DATA_MANAGER)) { Log.debug(Geonet.DATA_MANAGER, " - rule:" + schematron.getRuleName()); } applicableSchematron.add(applicable); } } return applicableSchematron; }  Element applyCustomSchematronRules(String schema, int metadataId, Element md,
                                              String lang, List<MetadataValidation> validations); List<ApplicableSchematron> getApplicableSchematronList(final int metadataId,
                                                           final Element md,
                                                           final MetadataSchema metadataSchema); ApplicableSchematron getApplicableSchematron(final int metadataId,
                                                 final Element md,
                                                 final MetadataSchema metadataSchema,
                                                 final Schematron schematron);  }
@Test public void testGetApplicableSchematronList() throws Exception { List<ApplicableSchematron> applicableSchematron = schematronValidator.getApplicableSchematronList(id, metadata, schema); boolean found = false; for (ApplicableSchematron applicable : applicableSchematron) { found |= applicable.schematron.getId() == schematron.getId(); } }