It's very strange also with:
StreamSupport.stream(startNodes.spliterator(), false).flatMap(vertex1 -> StreamSupport.stream(vertex1.getEdges(Direction.OUT, relationshipId).spliterator(), false)).collect(Collectors.toList())
It seems like I am unable to detect the outgoing edges of the vertices.
They seem to be all null.
I've added them like this:
Iterable<Vertex> startNodes = this.getVertexList(storage.getStartNode(), graph);
Iterable<Vertex> endNodes = this.getVertexList(storage.getEndNode(), graph);
for (Vertex startNode : startNodes)
{
for (Vertex endNode : endNodes)
{
String edgeClass = "class:" + storage.getId();
Edge edge = startNode.addEdge(edgeClass, endNode);
for (Map.Entry<String, Object> entry : storage.getProperties().entrySet())
{
edge.setProperty(entry.getKey(), entry.getValue());
}
edge.setProperty(Constants.TAG_HASH, HashCreator.sha1FromRelationship(storage));
edge.setProperty(Constants.TAG_SNAPSHOT_ID, snapshotId);
}
}
graph.commit();
And it only detect ingoing vertices not the outgoing ones.