@Test
public void testOverrides() {

    CheckSpec left = new CheckSpec();
    CheckSpec right = new CheckSpec();
    assertFalse("left should not override right if either is unnamed", left.overrides(right));
    assertFalse("right should not override left if either is unnamed", left.isOverriddenBy(right));
    left.setName("base");
    right.setName("base");
    left.setTemplate("inheriting");
    assertFalse("left and right should not override each other when left must inherit", left.overrides(right));
    assertFalse("right and left should not override each other when left must inherit", left.isOverriddenBy(right));
    left.setTemplate(null);
    right.setTemplate("inheriting");
    assertFalse("left and right should not override each other when right must inherit", left.overrides(right));
    assertFalse("right and left should not override each other when right must inherit", left.isOverriddenBy(right));
    right.setTemplate(null);
    assertTrue("left and right should override each other with same name", left.overrides(right));
    assertTrue("right and left should override each other with same name", left.isOverriddenBy(right));
    left.setName("main/base");
    assertFalse("left should not override right if left name is not same or suffix of right name", left.overrides(right));
    assertTrue("right should override left if right is suffix of left name", left.isOverriddenBy(right));
    right.setName("core/base");
    assertFalse("right should not override left if right name is not same or suffix of left name", left.isOverriddenBy(right));
}