/** * Converts {@link ModelVerifier} into {@link VerifyRuleFactory}. * @param rulePath the path which represents the verification rule description * @param extraRules the extra verification rules * @return the equivalent {@link VerifyRuleFactory} * @since 0.6.0 */ protected final VerifyRuleFactory toVerifyRuleFactory( String rulePath, List<? extends ModelTester<? super T>> extraRules) { try { TestDataToolProvider tools = getTestTools(); List<TestRule> fragments = new ArrayList<>(); for (ModelTester<? super T> tester : extraRules) { fragments.add(tools.toVerifyRuleFragment(getDataModelDefinition(), tester)); } return tools.getVerifyRuleFactory(toUri(rulePath), fragments); } catch (URISyntaxException e) { throw new IllegalStateException(MessageFormat.format( "Invalid rule path: {0}", //$NON-NLS-1$ rulePath), e); } }