StandardRuleResolver implements NormalizationRuleResolver { @Override public NormalizationRuleSet resolve(String ruleSetId) { ArgumentChecker.notNull(ruleSetId, "Rule set ID"); for (NormalizationRuleSet normalizationRuleSet : _rules) { if (ruleSetId.equals(normalizationRuleSet.getId())) { return normalizationRuleSet; } } return null; } StandardRuleResolver(Collection<NormalizationRuleSet> rules); @Override NormalizationRuleSet resolve(String ruleSetId);  }
@Test public void resolve() { Collection<NormalizationRuleSet> supportedRules = Collections.singleton(StandardRules.getNoNormalization()); StandardRuleResolver resolver = new StandardRuleResolver(supportedRules); NormalizationRuleSet rules = resolver.resolve("No Normalization"); assertNotNull(rules); rules = resolver.resolve("Nonexistent"); assertNull(rules); }