MappingRuleMatchers { public static MappingRuleMatcher createAllMatcher() { return new MatchAllMatcher(); } private  MappingRuleMatchers(); static MappingRuleMatcher createUserMatcher(String userName); static MappingRuleMatcher createUserGroupMatcher(String groupName); static MappingRuleMatcher createUserGroupMatcher(
      String userName, String groupName); static MappingRuleMatcher createApplicationNameMatcher(String name); static MappingRuleMatcher createAllMatcher();  }
@Test public void testToStrings() { MappingRuleMatcher var = new MappingRuleMatchers.VariableMatcher("%a", "b"); MappingRuleMatcher all = MappingRuleMatchers.createAllMatcher(); MappingRuleMatcher and = new MappingRuleMatchers.AndMatcher(var, all, var); MappingRuleMatcher or = new MappingRuleMatchers.OrMatcher(var, all, var); assertEquals("VariableMatcher{variable='%a', value='b'}", var.toString()); assertEquals("MatchAllMatcher", all.toString()); assertEquals("AndMatcher{matchers=[" + var.toString() + ", " + all.toString() + ", " + var.toString() + "]}", and.toString()); assertEquals("OrMatcher{matchers=[" + var.toString() + ", " + all.toString() + ", " + var.toString() + "]}", or.toString()); }