SchemeValuePair { public boolean matches(SchemeValuePair svp) { if (isComparableSVPSubclass(svp)) { return matches(svp.getScheme(), svp.getValue()); } else { return false; } } SchemeValuePair(String scheme, String value);  SchemeValuePair(String value); static void allowNullScheme(String... classNames); static void mapBehavior(String className, SchemeValueBehavior behavior); static void setSchemeURIAlias(String canonicalURI, String aliasURI); String getScheme(); String getValue(); @Override boolean equals(Object o); boolean isComparableSVPSubclass(Object o); boolean matches(SchemeValuePair svp); boolean matches(String scheme, String value); boolean areNullSchemesAllowed(); @Override String toString();  }
@Test public void testMatches() { SchemeValuePair.allowNullScheme(FiscalActionType.class.getName()); FiscalActionType fiscalActionTypeWithNullScheme = new FiscalActionType(null, Version1FiscalActionType.CANCEL.getValue()); Assert.assertTrue("Allow null for scheme doesn't work when this.scheme != null.", Version1FiscalActionType.CANCEL.matches(fiscalActionTypeWithNullScheme)); Assert.assertTrue("Allow null for scheme doesn't work when this.scheme == null", fiscalActionTypeWithNullScheme.matches(Version1FiscalActionType.CANCEL)); Assert.assertFalse("A Version1CurrencyCode.USD should not match Version1Language.ENG.", Version1Language.ENG.matches(Version1CurrencyCode.USD)); Assert.assertFalse("A Version1Language.ENG should not match Version1CurrencyCode.USD.", Version1CurrencyCode.USD.matches(Version1Language.ENG)); }