Skip to content

Instantly share code, notes, and snippets.

@lciolecki
lciolecki / MemoryRepository.java
Created April 17, 2021 10:26 — forked from xaverkapeller/MemoryRepository.java
A Repository implementation backed by an in memory Map. Intended to be subclassed for an Entity.
import org.springframework.data.repository.CrudRepository;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;