DefaultCrudRepository extends CrudRepositorySupport { public boolean existsById(Object key) { return getDataStore().hasKey(key); }  Iterable<Object> saveAll(Iterable entities); Optional<Object> findById(Object key); boolean existsById(Object key); Iterable findAllById(Iterable ids); Object delete(Object id); Object deleteById(Object entity); Iterable delete(Iterable entities); Iterable deleteAll();  }
@Test public void testExists() { final String key = "1234"; assertThat(repository.existsById(key), is(false)); dataStore.save("1234", new Person()); assertThat(repository.existsById(key), is(true)); }