code: private List<AtlasEdge> removeUnusedEntries(AtlasVertex instanceVertex, String edgeLabel,
                                               Collection<AtlasEdge> currentEntries,
                                               Collection<AtlasEdge> newEntries,
                                               IDataType entryType, AttributeInfo attributeInfo) throws AtlasException {
          if (currentEntries != null && !currentEntries.isEmpty()) {
              LOG.debug("Removing unused entries from the old collection");
              if (entryType.getTypeCategory() == TypeCategory.STRUCT
                      || entryType.getTypeCategory() == TypeCategory.CLASS) {
  
                  //Remove the edges for (current edges - new edges)
                  List<AtlasEdge> cloneElements = new ArrayList<>(currentEntries);
                  cloneElements.removeAll(newEntries);
                  List<AtlasEdge> additionalElements = new ArrayList<>();
  
                  if (LOG.isDebugEnabled()) {
                      LOG.debug("Removing unused entries from the old collection - {}", cloneElements);
                  }
  
                  if (!cloneElements.isEmpty()) {
                      for (AtlasEdge edge : cloneElements) {
                          boolean deleted = deleteHandler.deleteEdgeReference(edge, entryType.getTypeCategory(),
                                  attributeInfo.isComposite, true);
                          if (!deleted) {
                              additionalElements.add(edge);
                          }
                      }
                  }
                  return additionalElements;
              }
          }
          return new ArrayList<>();
      }
docs: Removes unused edges from the old collection, compared to the new collection