code: private List<AtlasEdge> removeUnusedArrayEntries(AtlasAttribute attribute, List<AtlasEdge> currentEntries, List<AtlasEdge> newEntries) throws AtlasBaseException {
          if (CollectionUtils.isNotEmpty(currentEntries)) {
              AtlasType entryType = ((AtlasArrayType) attribute.getAttributeType()).getElementType();
  
              if (AtlasGraphUtilsV1.isReference(entryType)) {
                  Collection<AtlasEdge> edgesToRemove = CollectionUtils.subtract(currentEntries, newEntries);
  
                  if (CollectionUtils.isNotEmpty(edgesToRemove)) {
                      List<AtlasEdge> additionalElements = new ArrayList<>();
  
                      for (AtlasEdge edge : edgesToRemove) {
                          boolean deleted = deleteHandler.deleteEdgeReference(edge, entryType.getTypeCategory(), attribute.isOwnedRef(),
                                                                               true, attribute.getRelationshipEdgeDirection());
  
                          if (!deleted) {
                              additionalElements.add(edge);
                          }
                      }
  
                      return additionalElements;
                  }
              }
          }
  
          return Collections.emptyList();
      }
docs: Removes unused edges from the old collection, compared to the new collection