Session extends DynamicDataContainer implements DateHolder { public void playerKilled(PlayerKill kill) { playerKills.add(kill); } Session(UUID uuid, UUID serverUUID, long sessionStart, String world, String gm);  Session(
            int id, UUID uuid, UUID serverUUID,
            long sessionStart, long sessionEnd,
            int mobKills, int deaths, long afkTime
    ); void endSession(long endOfSession); void changeState(String world, String gm, long time); void playerKilled(PlayerKill kill); void mobKilled(); void died(); long getLength(); @Override long getDate(); void setWorldTimes(WorldTimes worldTimes); @Override boolean equals(Object o); boolean isFetchedFromDB(); void addAFKTime(long timeAFK); void setSessionID(int sessionID); void setAsFirstSessionIfMatches(Long registerDate); boolean isFirstSession(); List<PlayerKill> getPlayerKills(); @Override int hashCode(); void setPlayerKills(List<PlayerKill> playerKills); @Override String toString(); void updateState();  }
@Test void killsAreAdded() { Session session = new Session(null, serverUUID, System.currentTimeMillis(), "", ""); Optional<List<PlayerKill>> beforeOptional = session.getValue(SessionKeys.PLAYER_KILLS); assertTrue(beforeOptional.isPresent()); List<PlayerKill> before = beforeOptional.get(); assertTrue(before.isEmpty()); session.playerKilled(new PlayerKill(TestConstants.PLAYER_TWO_UUID, "Weapon", System.currentTimeMillis())); Optional<List<PlayerKill>> afterOptional = session.getValue(SessionKeys.PLAYER_KILLS); assertTrue(afterOptional.isPresent()); List<PlayerKill> after = afterOptional.get(); assertFalse(after.isEmpty()); assertEquals(before, after); }
@Test void killsAreAdded2() { Session session = new Session(null, serverUUID, System.currentTimeMillis(), "", ""); session.playerKilled(new PlayerKill(TestConstants.PLAYER_TWO_UUID, "Weapon", System.currentTimeMillis())); Optional<List<PlayerKill>> afterOptional = session.getValue(SessionKeys.PLAYER_KILLS); assertTrue(afterOptional.isPresent()); List<PlayerKill> after = afterOptional.get(); assertFalse(after.isEmpty()); }