@Test public void put() { PunishmentData punishmentData = mock(PunishmentData.class); UUID uuid = UUID.randomUUID(); repository.put(uuid, punishmentData); final Optional<PunishmentData> cachedDataOptional = repository.getPunishmentData(uuid); assertTrue(cachedDataOptional.isPresent()); cachedDataOptional.ifPresent(cachedData -> assertEquals(cachedData, punishmentData)); }
public void put(UUID uuid, PunishmentData punishmentData) { cache.put(uuid, punishmentData); }
PunishmentDataRepository { public void put(UUID uuid, PunishmentData punishmentData) { cache.put(uuid, punishmentData); } }
PunishmentDataRepository { public void put(UUID uuid, PunishmentData punishmentData) { cache.put(uuid, punishmentData); }  }
PunishmentDataRepository { public void put(UUID uuid, PunishmentData punishmentData) { cache.put(uuid, punishmentData); }  Optional<PunishmentData> findPunishmentData(UUID uuid); void put(UUID uuid, PunishmentData punishmentData); Optional<PunishmentData> getPunishmentData(UUID uuid); void update(PunishmentData punishmentData); void save(PunishmentData punishmentData); void invalidate(UUID uuid); }
PunishmentDataRepository { public void put(UUID uuid, PunishmentData punishmentData) { cache.put(uuid, punishmentData); }  Optional<PunishmentData> findPunishmentData(UUID uuid); void put(UUID uuid, PunishmentData punishmentData); Optional<PunishmentData> getPunishmentData(UUID uuid); void update(PunishmentData punishmentData); void save(PunishmentData punishmentData); void invalidate(UUID uuid);  }