private void addHashChangeNotifications(AbstractElement<?, ?> entity, Hashes newHashes, List<Notification<?, ?>> notifications) { DBG.debugf("Adding hash change notifications to entity %s", entity.getPath()); if (entity instanceof Syncable) { Syncable el = (Syncable) entity; if (!Objects.equals(el.getSyncHash(), newHashes.getSyncHash())) { notifications.add(new Notification<>(el, el, syncHashChanged())); } } if (entity instanceof ContentHashable) { ContentHashable el = (ContentHashable) entity; if (!Objects.equals(el.getContentHash(), newHashes.getContentHash())) { notifications.add(new Notification<>(el, el, contentHashChanged())); } } if (entity instanceof IdentityHashable) { IdentityHashable el = (IdentityHashable) entity; if (!Objects.equals(el.getIdentityHash(), newHashes.getIdentityHash())) { notifications.add(new Notification<>(el, el, identityHashChanged())); } } }