class EntityOwnerChangeListener extends AbstractEntityOwnerChangeListener {

    @Override
    public void onDataTreeChanged(final Collection<DataTreeCandidate> changes) {
        for (DataTreeCandidate change: changes) {
            DataTreeCandidateNode changeRoot = change.getRootNode();
            LeafNode<?> ownerLeaf = (LeafNode<?>) changeRoot.getDataAfter().get();

            LOG.debug("{}: Entity node changed: {}, {}", logId(), changeRoot.getModificationType(),
                    change.getRootPath());

            String newOwner = extractOwner(ownerLeaf);

            String origOwner = null;
            Optional<NormalizedNode<?, ?>> dataBefore = changeRoot.getDataBefore();
            if (dataBefore.isPresent()) {
                origOwner = extractOwner((LeafNode<?>) changeRoot.getDataBefore().get());
            }

            LOG.debug("{}: New owner: {}, Original owner: {}", logId(), newOwner, origOwner);

            if (!Objects.equals(origOwner, newOwner)) {
                boolean isOwner = localMemberName.equals(newOwner);
                boolean wasOwner = localMemberName.equals(origOwner);
                boolean hasOwner = !Strings.isNullOrEmpty(newOwner);

                DOMEntity entity = createEntity(change.getRootPath());

                LOG.debug(
                    "{}: Calling notifyEntityOwnershipListeners: entity: {}, wasOwner: {}, isOwner: {}, hasOwner: {}",
                    logId(), entity, wasOwner, isOwner, hasOwner);

                publisher.notifyEntityOwnershipListeners(entity, wasOwner, isOwner, hasOwner);
            }
        }
    }

      EntityOwnerChangeListener(final MemberName localMemberName, final EntityOwnershipChangePublisher publisher);

}