docs: public static void deduplicate(SessionFactory sessionFactory, KeyspaceIndexPair keyspaceIndexPair) {
          SessionImpl session = sessionFactory.session(keyspaceIndexPair.keyspace());
          try (TransactionOLTP tx = session.transaction().write()) {
              GraphTraversalSource tinker = tx.getTinkerTraversal();
              GraphTraversal<Vertex, Vertex> duplicates = tinker.V().has(Schema.VertexProperty.INDEX.name(), keyspaceIndexPair.index());
              // Duplicates might be empty if the user deleted the attribute right after the insertion or deleted the keyspace.
              if (duplicates.hasNext()) {
                  Vertex mergeTargetV = duplicates.next();
                  while (duplicates.hasNext()) {
                      Vertex duplicate = duplicates.next();
                      try {
                          duplicate.vertices(Direction.IN).forEachRemaining(connectedVertex -> {
                              // merge attribute edge connecting 'duplicate' and 'connectedVertex' to 'mergeTargetV', if exists
                              GraphTraversal<Vertex, Edge> attributeEdge =
                                      tinker.V(duplicate).inE(Schema.EdgeLabel.ATTRIBUTE.getLabel()).filter(__.outV().is(connectedVertex));
                              if (attributeEdge.hasNext()) {
                                  mergeAttributeEdge(mergeTargetV, connectedVertex, attributeEdge);
                              }
  
                              // merge role-player edge connecting 'duplicate' and 'connectedVertex' to 'mergeTargetV', if exists
                              GraphTraversal<Vertex, Edge> rolePlayerEdge =
                                      tinker.V(duplicate).inE(Schema.EdgeLabel.ROLE_PLAYER.getLabel()).filter(__.outV().is(connectedVertex));
                              if (rolePlayerEdge.hasNext()) {
                                  mergeRolePlayerEdge(mergeTargetV, rolePlayerEdge);
                              }
                              try {
                                  attributeEdge.close();
                                  rolePlayerEdge.close();
                              } catch (Exception e) {
                                  LOG.warn("Exception while closing traversals:", e);
                              }
                          });
                          duplicate.remove();
                      } catch (IllegalStateException vertexAlreadyRemovedException) {
                          LOG.warn("Trying to call the method vertices(Direction.IN) on vertex {} which is already removed.", duplicate.id());
                      }
                  }
  
                  tx.commit();
              } else {
                  tx.close();
              }
  
              try {
                  tinker.close();
                  duplicates.close();
              } catch (Exception e) {
                  LOG.warn("Exception while closing traversals:", e);
              }
  
          } finally {
              session.close();
          }
      }