@Test
public void testNameStartsWith() throws Exception {

    final Setting s1 = settingRepository.save(new Setting().setName("NAME/abc").setValue("val"));
    final Setting s2 = settingRepository.save(new Setting().setName("NAME/abc2").setValue("val"));
    final Setting s3 = settingRepository.save(new Setting().setName("OTHER/abc").setValue("val"));
    List<Setting> found = settingRepository.findAll(SettingSpec.nameStartsWith("NAME/"));
    List<String> ids = Lists.transform(found, SETTING_NAME_FUNCTION);
    assertEquals(ids.toString(), 2, found.size());
    assertTrue(ids.contains(s1.getName()));
    assertTrue(ids.contains(s2.getName()));
    found = settingRepository.findAll(SettingSpec.nameStartsWith("OTHER/"));
    ids = Lists.transform(found, SETTING_NAME_FUNCTION);
    assertEquals(1, found.size());
    assertTrue(ids.contains(s3.getName()));
}