HierarchicalPropertiesEvaluator { public static boolean evaluate(ApplicationContext applicationContext, String... prefixes) { return evaluate(applicationContext.getEnvironment(), prefixes); } private  HierarchicalPropertiesEvaluator(); static boolean evaluate(ApplicationContext applicationContext, String... prefixes); static boolean evaluate(Environment environment, String... prefixes); static boolean evaluate(Environment environment, Collection<String> prefixes);  }
@Test public void testEvaluator() { Assert.assertFalse(HierarchicalPropertiesEvaluator.evaluate(environment, "test.group1", "test.group1.subgroup1")); Assert.assertTrue(HierarchicalPropertiesEvaluator.evaluate(environment, "test.group1", "test.group1.subgroup2")); Assert.assertFalse(HierarchicalPropertiesEvaluator.evaluate(environment, "test.group2", "test.group2.subgroup1")); Assert.assertTrue(HierarchicalPropertiesEvaluator.evaluate(environment, "test.group2", "test.group2.subgroup2")); Assert.assertFalse(HierarchicalPropertiesEvaluator.evaluate(environment, "test.group2", "test.group2.subgroup3")); }