### Question:
PunishmentDataRepository { public void update(PunishmentData punishmentData) { ebeanServer.update(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);  }### Answer:
@Test public void update() { UUID uuid = UUID.randomUUID(); PunishmentData punishmentData = new PunishmentData(uuid); PlayerProfile target = createProfile(uuid); repository.save(punishmentData); Optional<PunishmentData> optionalData = repository.findPunishmentData(uuid); assertTrue(optionalData.isPresent()); PunishmentData loadedData = optionalData.get(); loadedData.addPunishment(ActivePunishmentType.BAN, new ActivePunishmentRecord( "punisher", target, "reason", LocalDateTime.now(), ActivePunishmentType.BAN )); repository.update(loadedData); Optional<PunishmentData> afterUpdateOptional = repository.findPunishmentData(uuid); assertTrue(afterUpdateOptional.isPresent()); afterUpdateOptional.ifPresent(pd -> assertTrue( pd.getPunishment(ActivePunishmentType.BAN).isPresent())); }