@Override
 public void processUpdatedChanges(
     YangInstanceIdentifier identifier, UnderlayItem updatedItem, String topologyId) {
   LOG.trace("Processing updatedChanges");
   for (TopologyStore ts : topoStoreProvider.getTopologyStores()) {
     if (ts.getId().equals(topologyId)) {
       LOG.debug("Updating overlay item");
       UnderlayItem underlayItem = ts.getUnderlayItems().get(identifier);
       Preconditions.checkNotNull(
           underlayItem, "Updated underlay item not found in the Topology store");
       underlayItem.setItem(updatedItem.getItem());
       if (underlayItem.getCorrelationItem() == CorrelationItemEnum.Link) {
         if (underlayItem instanceof ComputedLink && updatedItem instanceof ComputedLink) {
           ComputedLink underlayLink = (ComputedLink) underlayItem;
           ComputedLink updatedLink = (ComputedLink) updatedItem;
           if (!matchTargetFields(underlayItem, updatedItem)
               || !underlayLink.getSrcNode().equals(updatedLink.getSrcNode())
               || !underlayLink.getDstNode().equals(updatedLink.getDstNode())) {
             underlayLink.setLeafNodes(updatedLink.getLeafNodes());
             underlayLink.setSrcNode(updatedLink.getSrcNode());
             underlayLink.setDstNode(updatedLink.getDstNode());
             if (underlayItem.getOverlayItem() != null) {
               removeUnderlayItemFromOverlayItem(underlayItem);
             }
             checkForPossibleAggregationOfLinks(updatedLink, underlayLink);
           } else if (underlayItem.getOverlayItem() != null) {
             // in case that only Link value was changed
             topologyManager.updateOverlayItem(underlayItem.getOverlayItem());
           }
           break;
         }
       } else {
         // if Leaf Node was changed
         if (!matchTargetFields(underlayItem, updatedItem)) {
           underlayItem.setLeafNodes(updatedItem.getLeafNodes());
           if (underlayItem.getOverlayItem() != null) {
             removeUnderlayItemFromOverlayItem(underlayItem);
           }
           checkForPossibleAggregation(underlayItem, topologyId);
         } else if (underlayItem.getOverlayItem() != null) {
           // in case that only Node value was changed
           topologyManager.updateOverlayItem(underlayItem.getOverlayItem());
         }
         break;
       }
     }
   }
 }
 private void removeUnderlayItemFromOverlayItem(UnderlayItem itemToRemove) {
   OverlayItem overlayItemIdentifier = itemToRemove.getOverlayItem();
   if (null != overlayItemIdentifier) {
     Queue<UnderlayItem> underlayItems = overlayItemIdentifier.getUnderlayItems();
     underlayItems.remove(itemToRemove);
     itemToRemove.setOverlayItem(null);
     if (underlayItems.size() < getMinUnderlayItems()) {
       LOG.debug("Removing overlay item");
       for (UnderlayItem remainingNode : underlayItems) {
         remainingNode.setOverlayItem(null);
       }
       topologyManager.removeOverlayItem(overlayItemIdentifier);
     } else {
       LOG.debug("Removing underlay item from overlay item");
       topologyManager.updateOverlayItem(overlayItemIdentifier);
     }
   }
 }
 /**
  * @param newItem item received from notification
  * @param topoStoreItem item already stored in topostore
  */
 private void aggregateItems(UnderlayItem newItem, UnderlayItem topoStoreItem) {
   if (topoStoreItem.getOverlayItem() == null) {
     LOG.debug("Creating new Logical Node");
     // create new logical node
     List<UnderlayItem> nodesToAggregate = new ArrayList<>();
     nodesToAggregate.add(newItem);
     nodesToAggregate.add(topoStoreItem);
     OverlayItem overlayItem =
         new OverlayItem(nodesToAggregate, topoStoreItem.getCorrelationItem());
     topoStoreItem.setOverlayItem(overlayItem);
     newItem.setOverlayItem(overlayItem);
     topologyManager.addOverlayItem(overlayItem);
     return;
   }
   LOG.debug("Adding physical node to existing Logical Node");
   // add new physical node into existing logical node
   OverlayItem overlayItem = topoStoreItem.getOverlayItem();
   newItem.setOverlayItem(overlayItem);
   overlayItem.addUnderlayItem(newItem);
   topologyManager.updateOverlayItem(overlayItem);
 }