- public static void addSnapshot(String persistentId, Object snapshot) {
- List<StoredSnapshot> snapshotList = snapshots.get(persistentId);
-
- if (snapshotList == null) {
- snapshotList = new ArrayList<>();
- snapshots.put(persistentId, snapshotList);
- }
+ public static void addSnapshot(final String persistentId, final Object snapshot) {
+ List<StoredSnapshot> snapshotList = snapshots.computeIfAbsent(persistentId, k -> new ArrayList<>());