DefaultCrudRepository extends CrudRepositorySupport { public Optional<Object> findById(Object key) { log.info("Attempting to load the entity with key " + key); return Optional.ofNullable(getDataStore().retrieve(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 testFindOne() { final String key = "1234"; assertThat(repository.findById(key), is(Optional.empty())); final Person person = new Person(); dataStore.save("1234", person); assertThat(repository.findById(key).isPresent(), is(true)); assertThat(repository.findById(key).get(), is(person)); }