@Test
public void testGetPropertyCategory() {

  String propertyId = "metrics/yarn/Queue/$1.replaceAll(\",q(\\d+)=\",\"/\").substring(1)/AppsRunning";
  String category = PropertyHelper.getPropertyCategory(propertyId);
  Assert.assertEquals("metrics/yarn/Queue/$1", category);
  category = PropertyHelper.getPropertyCategory(category);
  Assert.assertEquals("metrics/yarn/Queue", category);
  category = PropertyHelper.getPropertyCategory(category);
  Assert.assertEquals("metrics/yarn", category);
  category = PropertyHelper.getPropertyCategory(category);
  Assert.assertEquals("metrics", category);
  category = PropertyHelper.getPropertyCategory(category);
  Assert.assertNull(category);
}