entry -> {
final T val = entry.getValue();
if (Node.class.isAssignableFrom(val.getClass())) {
return (T) new Neo4jVertex((Node) val, this.graph);
} else if (Relationship.class.isAssignableFrom(val.getClass())) {
return (T) new Neo4jEdge((Relationship) val, this.graph);
} else {
return val;
}
}));
}