@Test(expected = IllegalArgumentException.class)
public void testBadSensorHierarchy() {

    Sensor p = metrics.sensor("parent");
    Sensor c1 = metrics.sensor("child1", p);
    Sensor c2 = metrics.sensor("child2", p);
    metrics.sensor("gc", c1, c2); // should fail
}