GlobStringsMatcher { public boolean isEmptyPatternsList() { return (patterns == null || patterns.size() == 0 || (patterns.size() == 1 && patterns.get(0).equals("^$"))); } GlobStringsMatcher(String systemProperty); boolean isEmptyPatternsList(); boolean isMatch(String value);  }
@Test public void testIsEmptyPatternsList() { String globStrings = "aaa.bbb.ccc.ddd, " + "???.ddd, " + "*.bbb.*.ddd, " + "aaa.??, "; String systemProperty = "athenz.zts.notification_cert_fail_ignored_services_list"; System.setProperty(systemProperty, globStrings); GlobStringsMatcher globStringsMatcher = new GlobStringsMatcher(systemProperty); assertFalse(globStringsMatcher.isEmptyPatternsList()); System.setProperty(systemProperty, ""); globStringsMatcher = new GlobStringsMatcher(systemProperty); assertTrue(globStringsMatcher.isEmptyPatternsList()); globStringsMatcher = new GlobStringsMatcher("some.other.property"); assertTrue(globStringsMatcher.isEmptyPatternsList()); System.clearProperty(systemProperty); }