For checking if an Edge contains Vertices a and b.
a
b
bool equalToVertices(Vertex a, Vertex b) { return this.a.equalsById(a) && this.b.equalsById(b) || this.a.equalsById(b) && this.b.equalsById(a); }