// observe any change to the collection
collection.register(new ChangeListener() {
@Override
public void onChange(ChangeInfo changeInfo) {
System.out.println("Action - " + changeInfo.getChangeType());
System.out.println("List of affected ids:");
for (NitriteId id : changeInfo.getChangedItems()) {
System.out.println("Id - " + id);
}
}
});