@Test
public void testInherits() {

    CheckSpec left = new CheckSpec();
    CheckSpec right = new CheckSpec();
    assertFalse("null left should not inherit null right", left.inherits(right));
    assertFalse("null right should not inherit null left", left.isInheritedBy(right));
    left.setName("left");
    left.setTemplate("");
    right.setName("");
    assertFalse("empty left should not inherit empty right", left.inherits(right));
    assertFalse("empty right should not inherit empty left", left.isInheritedBy(right));
    right.setName("right");
    assertFalse("empty left should not inherit empty right", left.inherits(right));
    assertFalse("empty right should not inherit empty left", left.isInheritedBy(right));
    left.setTemplate("notright");
    assertFalse("left with other template should not inherit right", left.inherits(right));
    assertFalse("right should not inherit left with other template", left.isInheritedBy(right));
    left.setTemplate("right");
    assertTrue("left with match template should inherit right", left.inherits(right));
    assertFalse("right should not inherit left with match template", left.isInheritedBy(right));
    right.setName("main/right");
    assertTrue("left with suffix-matching template should inherit right", left.inherits(right));
    assertFalse("right should not inherit left with suffix matching template", left.isInheritedBy(right));
}