@Test
public void testHasMetadataIdIn() throws Exception {

    Metadata md1 = newMetadata(_inc);
    md1 = _repository.save(md1);
    Metadata md2 = newMetadata(_inc);
    md2 = _repository.save(md2);
    List<Metadata> all = _repository.findAll((Specification<Metadata>)hasMetadataIdIn(Arrays.asList(md1.getId())));
    assertEquals(1, all.size());
    assertEquals(md1.getId(), all.get(0).getId());
    all = _repository.findAll((Specification<Metadata>)hasMetadataIdIn(Arrays.asList(md1.getId(), md2.getId())));
    assertEquals(2, all.size());
    all = _repository.findAll((Specification<Metadata>)hasMetadataIdIn(Collections.<Integer>emptyList()));
    assertTrue(all.isEmpty());
}