@Test
public void testIsTemplate() throws Exception {

    Metadata md1 = newMetadata(_inc);
    md1.getDataInfo().setType(MetadataType.METADATA);
    md1 = _repository.save(md1);
    Metadata md2 = newMetadata(_inc);
    md2.getDataInfo().setType(MetadataType.SUB_TEMPLATE);
    md2 = _repository.save(md2);
    assertFindsCorrectMd(md1, (Specification<Metadata>)isType(MetadataType.METADATA), false);
    assertFindsCorrectMd(md2, (Specification<Metadata>)isType(MetadataType.SUB_TEMPLATE), false);
}