@Test
public void testHasCategoryNameIn() throws Exception {

    final MetadataCategory category = categoryRepository.save(MetadataCategoryRepositoryTest.newMetadataCategory(_inc));
    final MetadataCategory category2 = categoryRepository.save(MetadataCategoryRepositoryTest.newMetadataCategory(_inc));
    final MetadataCategory category3 = categoryRepository.save(MetadataCategoryRepositoryTest.newMetadataCategory(_inc));
    final Specification<MetadataCategory> specification = MetadataCategorySpecs.hasCategoryNameIn(Arrays.asList
        (category.getName(), category3.getName()));
    final List<String> all = Lists.transform(categoryRepository.findAll(specification), new Function<MetadataCategory, String>() {
        @Nullable
        @Override
        public String apply(@Nullable MetadataCategory input) {
            return input.getName();
        }
    });
    assertEquals(2, all.size());
    assertTrue(all.contains(category.getName()));
    assertFalse(all.contains(category2.getName()));
    assertTrue(all.contains(category3.getName()));
}